Community
Participate
Working Groups
1. Open doctrine.js from the orion source code (bundles/org.eclipse.orion.client.ui/web/doctrine/doctrine.js) 2. The entire tab freezes and never recovers If you remove lines 44, 45 (which each contain a 4100-character-long string literal) the file opens with no problems. If you rename it to .txt instead of .js, it also opens fine.
esprima.js has a similar problem. It uses the same gigantic regex strings as doctrine
It's not actually hung, but is performing extremely slow. RegExp evaluations get increasingly slower in Chrome as the test string gets larger (ie.- a few seconds at the 200 character mark), and the problematic lines in doctrine.js are > 4200 characters each. For now I've released a char count check that skips over lines that are long enough to cause a noticeable performance problem. Will continue to investigate whether a better fix can be implemented. Commit: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=63df4903e4ee1a01d53c9a5c9356e1da74f868a5 .
I'm reasonably sure that better performance can be achieved through better regex's (less backtracking in particular). However with the 5.0M2 cut-off looming I'm hesitant to tinker with these because it's easy to introduce subtle problems. Will focus on these during the 5.0RC1 period.
Tracked the underlying issue down the regex's for JS multi-line strings, so these have been adjusted and the character count limit is now removed. Fixed > 20140128, commit: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=5595de4ce388cd8dc3a0f11539ff885652c5c0eb .