rkoeninger / ShenScript

Shen for JavaScript
BSD 3-Clause "New" or "Revised" License
57 stars 4 forks source link

npm audit. Micro optimization 50% improvement. #9

Closed vrescobar closed 5 years ago

vrescobar commented 5 years ago

In this thread/PR you will find commits for two different issues (github decided to join them instead of letting me do a separate PR)

All test cases pass. Seems to work but I didn't properly use it. Remember to run npm install after upgrade this code is applied. Please review the package.lock manually with a diff in the command line just in case something is incorrect (some packages made greater upgrades others were removed).

Closes #8

vrescobar commented 5 years ago

Closes #8

vrescobar commented 5 years ago

Added a commit for a microoptimization for mobile browsers Issue #7

After remove Object.freeze Mobile browser (safari iphone 6s) improved the load time to almost half (from 5942ms to 35XXms) when in development mode. When using development mode (uglified) it moved from 3028ms to 2154ms. No significant difference on desktop browser.

The development mode remains active for practical purposes.

rkoeninger commented 5 years ago

Good call on the Object.freeze. I had those in there earlier but didn't think they were helping.

Normally, I wouldn't like having unrelated changes in a PR (perf and npm audit) but whatever.

I'm going to roll back the async: false in the demo page since the demo is supposed to be able to handle things like web.fetch

rkoeninger commented 5 years ago

Thanks for contributing, @vrescobar !