|
|
Am 31.07.2015 um 17:10 schrieb Cousin Ricky:
> It seems that the complexity of the SDL makes more of a difference than
> the complexity of the underlying calculation, at least in this case.
Absolutely. As a general rule of thumb, the number of tokens processed
is the bottleneck, no matter what you do with SDL. (And remember that
SDL is an entirely interpreted language; no compilation done at all, so
tokens in loops are processed again and again and again.)
Unless you frequently call macros defined in a different source file.
Such macro calls are even significantly more expensive.
For heavy math, functions can be a way out, as those are parsed only
when defined.
> This now has me wondering what an LR(k) parser would do for POV-Ray
> parse times.
No need to dig deep into compiler theory - anything that's not a naive
interpreter, but does /some/ level of compilation instead, would be a
huge step forward ;)
POV-Ray's parser was fine as long as POV-Ray scene files were indeed
just plain scene descriptions. But the approach has become inadequate
ever since macros and loops were introduced.
Post a reply to this message
|
|