Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix major performance degradation from minimal indenting #288

Closed
bitwiseman opened this issue Jun 10, 2013 · 1 comment
Closed

Fix major performance degradation from minimal indenting #288

bitwiseman opened this issue Jun 10, 2013 · 1 comment

Comments

@bitwiseman
Copy link
Member

Before minimal indenting ( 68a8542 ), js-beautify had the following performance when run against jquery 2.0.2 ( http://code.jquery.com/jquery-2.0.2.js ):

----------------------------------------
Testing js-beautify cli performance...
beautified ../../../../../tmp/js-beautify-perf/jquery-2.0.2-output.js

real    0m0.238s
user    0m0.213s
sys 0m0.024s
----------------------------------------

After that commit the same command had the following results:

----------------------------------------
Testing js-beautify cli performance...
beautified ../../../../../tmp/js-beautify-perf/jquery-2.0.2-output.js

real    0m1.845s
user    0m1.821s
sys 0m0.030s
----------------------------------------

Admittedly, jquery 2.0.2 is a large file ( 237 Kb), but this is still pretty bad.

Use js/test/shell-perf-test.sh to measure results. Output will be machine specific, so baseline before making changes.

@bitwiseman
Copy link
Member Author

After the fix:

----------------------------------------
Testing js-beautify cli performance...
beautified ../../../../../tmp/js-beautify-perf/jquery-2.0.2-output.js

real    0m0.256s
user    0m0.229s
sys 0m0.025s
----------------------------------------

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant