phetsims / phet-core

Core utilities used by all PhET simulations.
MIT License
8 stars 6 forks source link

phetAllocations are taking too long #37

Closed samreid closed 6 years ago

samreid commented 6 years ago

While profiling wave interference, I noticed this in the profiler:

image

This is in requirejs mode. But I also noticed that window.phetAllocation is defined for a built sim. Is it being stripped out? Should we block it with:

assert && phetAllocation && phetAllocation(...)

I'm not seeing phetAllocation in the profiler for a built sim, but I'm not sure why. @jonathanolson what do you think is happening, and how should we proceed?

jonathanolson commented 6 years ago

It's stripped out in the uglify step. Generally I'd recommend grunt --mangle=false for profiling, since it keeps names but strips out all the things you generally want stripped out for performance.

samreid commented 6 years ago

Thanks, I just forgot that global_defs would strip things in the minify.