Stop using ThreadLocal<T>, use [ThreadStatic]#1460
Conversation
4bee7c8 to
0267227
Compare
|
This is weird... Barely any diffs because despite dropping over 10 KB worth of stuff from @MichalStrehovsky do you have any ideas on what could be going on? 🤔 Eg. this is the trace for that value tuple... But how is any change in this PR doing any of that? |
I don't know why is it only showing up after these changes; could be some visualization artifact or IDK, but the inclusion looks reasonable to me.
Note that dataflow analysis (the thing that computes dynamic use of reflection using the annotations, intrinsically recognized APIs, etc.) is a shared codebase with IL Linker and as such operates on uninstantiated method bodies. So we don't re-run it for each The only theory I have is that maybe before your change we avoided running dataflow analysis because we ended up running all You could check whether you're running into this bug by adding |
0267227 to
58bfc02
Compare
|
Re-run sizoscope after #1461, saves 16 KB now! 🎉 |



We're already using
[ThreadStatic]right below this, might as well just keep it consistent and use it for the stack of visited types too. This will save a little bit of binary size, as there was nothing else rooting the type otherwise (plus, one less lambda).