-
Notifications
You must be signed in to change notification settings - Fork 1
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
[Review] Optimal performance & supportability #12
Comments
MOSTLY resolved as of #11. Where possible,
Resolved as of #11 - stripped most out of the primary scripts and deprecated the
Resolved as of #11 - all repeated code has been refactored either into helper functions or removed.
Resolved as of #11 - all repeated code has been refactored into micro-helper function or removed.
Partial resolution as of #11 - some functions now go from one, to the next, rather than core -> function -> core -> function -> core -> function
Resolved as of #11 - all unnecessary vars removed, although there may be opportunity within the checkPolyfills function?
We're using
See this comment, that details some basic, high-level benchmark stats for a couple of common browsers (that I have access to).
|
End to end stats (using
It's calling out for:
That results in the 1.6s first run - as soon as they're in the browser cache, things are better! All stats gathered via Codepen: https://codepen.io/willstocks_tech/pen/YBEzLW |
Using the following as a benchmark (using Windows 10, Chrome 72 (all native features)1st run: 180ms (empty cache) Windows 10, IE111st run: 316ms (empty cache) Windows 10, Edge 40.15063.674.0 (EdgeHTML 15.15063)1st run: 358ms (empty cache) |
I'm going to keep this issue open for a while, just until the repo has settled a bit. Any performance-related improvements, pop a comment down below and I will add them to this list.
Current areas for improvement:
for
loops (resolved in [RELEASE] v0.0.5 #11)if
s (some nested unnecessarily) (resolved in [RELEASE] v0.0.5 #11)console.log
alternative? Stripped most out of them from the primary scripts (non-min and min) - only concern here is impact to mobile devices. No "data" is being shared at all! (resolved in [RELEASE] v0.0.5 #11)loadMyScript
function - move into helper functions? (resolved in [RELEASE] v0.0.5 #11)script
tobody
- is the current method the best method for all devices (not just desktop, but mobile too)? (https://jsperf.com/create-element-direct-append-vs-get-elements/1)var
,let
orconst
?if
's - are they being handled in the best way in general?switch
/case
or continue withif else
(https://jsperf.com/switch-case-vs-if-else/13)if
s within thechecking
function. See https://github.com/willstocks-tech/dynamically-polyfill-features-for-a-script/blob/develop/dynamicpolyfill.js#L40+L46dynamicPolyfill
has become potentially "Cognitively Complex" (see: https://codeclimate.com/github/willstocks-tech/dynamically-polyfill-features-for-a-script/pull/19)The text was updated successfully, but these errors were encountered: