https://forum.world.st/Two-new-curious-Context-primitive-questions-tp5125779.html
Hi all, hi Eliot,
new year, new simulation fun, and I have collected two new questions about the Context implementation which I'd love to get answered here:
First, I was confused by the following:
(BlockClosure >> #numArgs) primitive. "266"
(Context >> #pc) primitive. "0"
What makes Context so special that it cannot be compiled with quick accessor methods?
Second, Context >> #isPrimFailToken: attracted my attention multiple times when looking at different #timeProfile results of simulation sessions. In the expression [100000 factorial] it takes up more than 44% of the whole execution time!
I have no idea why it could be so slow, but this message is sent really often, which is at least 2 times per simulation of a special message send.
Would there be an easy change to resolve this bottleneck and speed up the simulation by 40% or more?
Would it be possible to provide a primitive for this method? Or do you see any other way to optimize it?
Best,
Christoph