nzakas/eslint — pull request #196 by ilyavolodin (2013-08-03 23:54:16+00:00)
Title: Improve performance of getTokens (Fixes #189)

I re-wrote getTokens to improve performance. I decided not to add tokens directly to ast, and instead I just populate them into hashtable with startLocation as a key.

Performance increase is pretty good. Running eslint with default rules on jshint file before the changes:
Days : 0
Hours : 0
Minutes : 0
Seconds : 41
Milliseconds : 917
Ticks : 419175419
TotalDays : 0.000485156734953704
TotalHours : 0.0116437616388889
TotalMinutes : 0.698625698333333
TotalSeconds : 41.9175419
TotalMilliseconds : 41917.5419

after the changes:

Days : 0
Hours : 0
Minutes : 0
Seconds : 1
Milliseconds : 968
Ticks : 19688548
TotalDays : 2.27876712962963E-05
TotalHours : 0.000546904111111111
TotalMinutes : 0.0328142466666667
TotalSeconds : 1.9688548
TotalMilliseconds : 1968.8548