Skip to content

Commit

Permalink
Replace wrapTrackingFunction() with inline location tracking.
Browse files Browse the repository at this point in the history
Summary: Apparently node is not very good at executing these wrapped
functions. Bringing the code closer to the master implementation, but
using local vars instead of the marker stack (markStart/markEnd/markEndIf).

The idea is that all parseXXX functions should return nodes with
range/loc properties set when the tracking is on (master doesn't always
follows it though). I also think this implementation is easier to
maintain and less error-prone than the wrapping one.

I profiled it on a fairly large codebase (5k files/19MB of JS):

Tracking off: master = 3.3s, harmony = 3.2s, my patch = 3.3s (harmony is slightly faster)
Tracking on: master = 5.9s, harmony = 7.8s, my patch = 5.5s (makes it slightly faster than master vs 30% slower)

Test Plan: npm test
  • Loading branch information
Andrey Sukhachev committed Mar 26, 2014
1 parent ad38ed2 commit f7d3248
Showing 1 changed file with 306 additions and 569 deletions.
Loading

0 comments on commit f7d3248

Please sign in to comment.