Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mraleph
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
15 ms
·
91.
▲
by
mraleph
11y ago
> Interesting to see them moving away from AST-to-ASM and building an IR, which looks to be a CFG. V8 actually has been using a compiler with a proper IR since 2010 when Crankshaft[1] was released. [1] http://blog.chromium.org
92.
▲
by
mraleph
11y ago
> Lua also has finalizers, which effect the GC's design. V8 has a weak callback mechanism, which (while not exposed to JS) allows reentering JS from inside a weak callback - which means you can emulate Lua's __gc on top of this
93.
▲
by
mraleph
11y ago
> Worth noting that IIRC, for a while LuaJIT in interpreted mode was able to beat V8 in optimized mode not all that infrequently V8 had no optimizing compiler when Mike Pall sent his (in)famous mail about "LuaJIT interpreter beati
94.
▲
by
mraleph
11y ago
Arguably it's an optimization that compiler could perform instead and a method JIT most likely would. However tracing JIT's optimizations are confined to a linear trace - which I guess exactly the limitation the author wanted to d
95.
▲
by
mraleph
11y ago
I would not call it a performance hack, it's just a readable way to write an algorithm - most important part of my original suggestion was actually to use x.charCodeAt(i) instead of x[i]
96.
▲
by
mraleph
11y ago
It's written with continue precisely to avoid additional `if (j === hlen)` check after the loop and having a single increment of `j` in the loop :) To be honest reasoning about the loop with continue is actually easier than about one w
97.
▲
by
mraleph
11y ago
> The set of things you are worrying about it actually precisely the set of things CLZ solves :) I think the set of things I worry about is slightly different, because they operate in a static environment and I operate in a dynamic one.
98.
▲
by
mraleph
11y ago
> The only case that arr.length could change, and hence the if statement taken, is if the if statement had already been taken - i.e. arr.length had already changed. Fair point. I misread your original comment. To see this you need a more
99.
▲
by
mraleph
11y ago
I always pronounce it as /līkm/, but I am not a native speaker so I can't be sure about correct pronunciation.
100.
▲
by
mraleph
11y ago
> Why does this require JS (to the point of giving a blank page!) for something that can be trivially done without? This is a slide deck (not a blog post or article) hence its dependence on JS. (though even blog posts I write usually dep
101.
▲
by
mraleph
11y ago
Yes, you are absolutely right - semantics is quite different. But that's not what changes perf here - the difference comes from whether there is an explicit property load or a property load is an implicit part of the method call. This
102.
▲
by
mraleph
11y ago
Thanks, I am glad you like my blog :) I might write something about TF but right now it's still not used to compile normal code and the team is just starting on stuff like adaptive optimizations, so it's a bit too early. Also give
103.
▲
by
mraleph
11y ago
Indeed there are some relatively well understood negative consequences to LICM and various other redundancy elimination optimizations: e.g. they increase life-time of values which can have negative impact on register allocation. Another thi
104.
▲
by
mraleph
11y ago
Oops, sorry for that. Forgot to shrink them before publishing. Will fix as soon as I get to a place with a stable internet connection - traveling right now. upd. done, scaled down to 1024x768
105.
▲
by
mraleph
11y ago
I obviously craft/collect examples of V8 going off the rails for these talks just to show that VMs are software and all software has bugs --- and those bugs don't necessarily manifest as crashes and incorrect results - they can le
106.
▲
by
mraleph
11y ago
> LICM is a very simple thing to do. Yeah, it sometimes surprises me how much value the most simple optimizations have and how much they break people's attempts to measure performance. There is another side to this medal which is be
107.
▲
by
mraleph
11y ago
It was recorded but I don't know when it will be publicly released. This talk is a combination of two separate talks I have given before plus two new examples, based on my recent endeavors. Talks merged here are LXJS 2013 one[1] where
108.
▲
by
mraleph
12y ago
Dart VM is an essential part of the Dart ecosystem. Dart tools: pub's (package manager) client, analyzer, dart2js compiler, etc are all written in Dart. We have a good story for server side developement and we are not looking to abando
109.
▲
by
mraleph
12y ago
Dart VM is not going anywhere.
110.
▲
by
mraleph
12y ago
Sealing prototypes is easy - V8 already "pseudo"seals them: it removes the map checks against prototypes and instead deoptimizes the code depending on hidden classes when somebody changes them. Similar pseudo-sealing technique can
111.
▲
by
mraleph
12y ago
Thanks for the update. I posted this reply on your site, but I will duplicate it here for the sake of HN readers: > BTW --nouse-osr makes all three tests run faster. As I tried to explain above: OSR at it is implemented now impacts code
112.
▲
by
mraleph
12y ago
Is it 10% slower even if you keep array alive and apply --nouse-osr (to both node.js and io.js)? On my machine results are fluctuating within the same ballpark (though I am on Linux and benchmarking 64-bit builds).
113.
▲
by
mraleph
12y ago
Ok reporting back. There are two issues here. The first major one is related to mortality of TypedArray's maps (aka hidden classes). When typed array stored in the Data variable is GCed and there are no other Uint8Array in the heap the
114.
▲
by
mraleph
12y ago
I can explain what happened to Array case. 100000 used to be the threshold at which new Array(N) or arr.length = N started to return a dictionary backed array. Not anymore: this was changed by https://codereview.chromium.org/
115.
▲
by
mraleph
12y ago
Try running something OOPy instead of a tight loopy code, e.g. DeltaBlue, you will discover that LuaJIT has weaknesses too. Though I must admit V8 could handle dictionaries a bit better - but at the moment it does not.
116.
▲
by
mraleph
12y ago
I have amended the section, please check it out. There is certain technical heritage here. Originally method calls compiled down to a single IC that did load and call within a IC stub. Type feedback from these ICs was interpreted in the sa
117.
▲
by
mraleph
12y ago
> I do think the blog post implies that v8 can't do polymorphic inlining. It took me a bit to realize where this confusion comes from (especially given the whole discussion of how polymorphic property access is handled). Is it due
118.
▲
by
mraleph
12y ago
V8 can inline at bimorphic (trimorphic and quadmorphic :)) site. That's explicitly stated in the post: see the part about decision tree building. When you inline at polymorphic site in the worst case you have branching flow graph tha
119.
▲
by
mraleph
12y ago
I totally agree with you! I would love to have equivalent functionality built right into Dev Tools. Immediacy is a very important aspect of usability - I would like to inspect a running program without any special movements. > upload fil
120.
▲
by
mraleph
12y ago
Thanks! You are absolutely correct in summarizing two underlying themes for my microbenchmarking related posts: (a) one needs to understand what one is measuring (b) one needs to understand if that actually matters for their project. >
More ›