felipecrv commented on PR #44191:
URL: https://github.com/apache/arrow/pull/44191#issuecomment-2369769432

   I agree with @pitrou.
   
   `goto` was deemed harmful by Dijkstra because it made proving the 
correctness of a program (specially termination checking) harder than with 
structured constructs, but in the case of a parser, the high-level languages we 
use don't give us great tools. As such you will find `goto` in many parsers in 
the wild even when most of the non-parser code in the same codebase doesn't use 
gotos.
   
   A parser without goto is more branchy. All the parser state must be 
represented in data instead of being represented in the instruction pointer 
(which is what goto mutates). These extra branches might affect performance (if 
the compiler can't make flatten the structured code as we can).
   
   If a label has multiple gotos pointing to it, the version without goto may 
need functions. This may lead to code repetition due to inlining and worse 
instruction cache usage.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to