-
-
Notifications
You must be signed in to change notification settings - Fork 886
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
Tweaks #500
Tweaks #500
Conversation
Automated change using eslint-config-atomic
Pull Request Test Coverage Report for Build 959700730Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Isn't using string literals and
Neither of these things can be optimised by terser etc. Granted the overall the performance impact is tiny, however, for a framework like this, shouldn't we be brutal when it comes to performance? |
Hmm.. I didn't think about I think the |
I was playing with this and actually terser does transform Although I often use that option in my own toy projects, it's kind of dangerous when working on large code bases or when the runtime JS environment is non-standard (I sometimes work on web based apps which run on games consoles, TVs, etc. which can be full of surprises in their JS/CSS stack). |
@maxmilton Anyway, even running your benchmarks, If we want to only look at Ignition interpreter (0 optimizations), this is what v8 generates: const booled = !!x 00000393081D2EF9 @ 15 : 0b fa Ldar r0
00000393081D2EFB @ 17 : 54 ToBooleanLogicalNot
00000393081D2EFC @ 18 : 55 LogicalNot
00000393081D2EFD @ 19 : bd Star6 const booled = Boolean(x) 00000386081D2EFD @ 15 : 21 02 00 LdaGlobal [2], [0]
00000386081D2F00 @ 18 : b7 Star12
00000386081D2F01 @ 19 : 61 ee fa 02 CallUndefinedReceiver1 r12, r0, [2]
00000386081D2F05 @ 23 : bd Star6 As you see, the second generates only one operation which is If your app is suffering from huge size, there are better ways to reduce it than trying to remove some characters here and there. Considering Gzip, |
Oh, nice! That's exciting because I've always favoured I ran the benchmark on various OS + browser combos and got mixed results. In most cases Yes, it's an additional op for the double logical not, which was a mystery why it was traditionally faster. I always assumed either double logic not compiled into some fast path or Boolean() done some extra checks under the hood. Shouldn't the benchmark result account for code executed through Ignition, Sparkplug, and Turbofan? TBH I'm not very knowledgeable about the underlying schematics of when JS or bytecode gets promoted to an optimising compiler... I just assume after a certain number of runs and no deopts but there's probably a lot more depth to it. Not important for this discussion I guess but fascinating anyway.
|
I optimized the SUSPENSE_REPLACE regex
I also modernized some parts of the code by
Similar to solidjs/solid-router#17