When performing a System.Object.equals() comparison on TokenType values (as might happen if you do
if (token.Type == TokenType.Error)
), two GC allocations seem to occur (in world SDK 3.10.3 - I can't confirm if this happens in-client, but if there's a difference here it makes it effectively impossible to optimize Udon scripts to reduce GC hitching).
See attached screenshot - I have some harmony hooks in to apply profiler markers around extern calls. If you need the harmony hooks for comparison, here they are: https://gist.github.com/bdunderscore/c325c6e1fc8d29a6c501c6eda09ca0fc

Photo Viewer

View photos in a modal