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
added fix for utf8 multi-byte boundary when it is split between chunks, ... #12
Conversation
…s, also created a test for this scenario, and made sure all current tests still pass in node and on the browser side
In reference to #11 |
added fix for utf8 multi-byte boundary when it is split between chunks, ...
Publishing this right now. Reference to the other case: |
I don't think it causes any problems, but it essentially performs the same as Related: Seems like @indutny tried to improve this before: https://codereview.chromium.org/8499010/ |
If switch cases are integers it would not behave any different from a sequence of ifs. If switch cases are string literals then in some cases it might behave worse: https://code.google.com/p/v8/issues/detail?id=2684 If switch fits neither of those two cases the function it is contained in is never optimized. Manually reordering switch to have most common cases on top will improve performance. At least until V8 starts doing some sophisticated switch optimizations itself. |
@dscape I'm not using it in production, I identified the bug initially using @dominictarr's |
Echoing what @mraleph said above. My own experience on the use of Profile-guided tweaks is also easy: http://ariya.ofilabs.com/2012/02/javascript-branching-and-code-shuffling.html. Just my $0.02. |
You might like this then: https://codereview.chromium.org/16128004/ |
@jlank that would be awesome! |
@indutny Yep, looking forward to trying it out :) |
@ariya It hasn't landed, but you can try pulling it in and running benchmarks to see if it helps. |
Thank everyone for the input!! :) This is why open source is awesome. @jlank would love to read a blog post about your findings in the end, sounds like you'll have a lot of insight into this by then 💯 |
@dscape you can count on it.. I have a draft post from my initial fix to |
...also created a test for this scenario, and made sure all current tests still pass in node and on the browser side. Sorry for the kinda messy diff, a force of habit of mine is removing trailing whitespace in vim with
,ss
, it's so fun to get rid of them! :P