
@cadr here are the results: https://gist.github.com/4d17d6ea50d0cc75d2c3a4676521280a

that includes traces for both in-a-linklet and not on latest pycket, plus a trace for just the first loop prior to starting the linklet branch

you can see a few things:

- the loop after the peeled iteration (the third loop for all three) has a
guard_nonnull
in the linklet code but not in the others

- the peeled iteration (the second loop) has a bunch of checks for the current linklet instance, even in the code that doesn’t use linklets at all, which wasn’t there before the linklet branch

Also note that these are all lexical variables (except <
and -
) and so shouldn’t be doing anything with the current linklet instance

@samth That kind of makes sense to me (your second observation), because right now each environment cell (like ConsEnv) and closures have the extra current_linklet_instance
field, but if I’m not mistaken the only thing that currently depends on it is variable-references, which I’m not sure if it’s absolutely necessary, and I’m pretty sure that the linklet variables doesn’t need the current instance to be in every env cell, or closures etc, since they always get it from the toplevelenv (which is freshly created for each instantiation)

I’m going to work on these performance issues on traces once I’m done with making this branch fully work and merge

also the technqiue I described is very useful for getting traces quickly

Absolutely, thank you for that, I’m sure it’ll be super helpful
