|
Found the little bugger!
In 1.7, a new compressor was instantiated per javascript file.
In 2.x, a new compressor is instantiated per msbuild task call.
There is a class level variable (_globalScope) in the compressor which needs to be initialised per compression call - this happened "naturally" in 1.7 due to a new instance every time, but not in 2.x with a single instance.
The result was an every growing array of script or function scopes to visit as more and more files were compressed...which increased the compression time overall as we have seen.
For a list of 20 files (well, the same file 20 times), the number of calls to a key function, (Munge) went from 18,140 in 1.7 to 190,280 in 2.x - EPIC FAIL :/
It is now back down to 18,140 in both cases.
Thanks Epstone for your perfect example of a bug report - a self contained example of a problem. Saved a lot of time in investigating this issue.
Thanks also to Jetbrains dotTrace, which put a bloody great "look here" pointer to the offending code :)
Have checked in a fix so you can grab the latest sources and build yourself a faster 2.1, or wait for PK to issue an "official" release
|