Thanks for the link to that video, I'll give it a look. Based on your
suggestion I'll try doing a custom build of Chromium and see if the
disassembly will let me make sense of things.
The reason this is a real problem for me (and why I find the lack of
documentation for this stuff in chromium frustrating) is that I'm
machine-translating code from other languages to JS - hand-editing it
to make it faster is something I can do for code I'm writing myself,
but I can't do it in a compiler. The current nature of the performance
feedback from V8 makes it more or less a black box and this is
worsened by the fact that a large amount of the documentation I've
found out there that claims to describe V8 performance characteristics
is either wrong or outdated. When you profile an application in V8 and
the web inspector says you're spending 50% of your time in a simple
function, your only choice is to dig deeper to try and understand why
that function is slow. You could solve this by offering line-level
profiling data in your profiler, but I think that's probably a ton of
work, so I'm not asking for that. ;)
To provide one example: I did some spelunking around with
--trace-deopt and --trace-bailouts and found that in my codebase,
basically any use of the 'arguments' object - even just checking
'arguments.length' - causes the entire function to be deoptimized. Of
course, there isn't a ton of documentation here, but
http://s3.mrale.ph/nodecamp.eu/#57 along with other sources claim that
this is not the case. So, either something creepy is happening in my
test cases - more verbose feedback from V8 here, or concrete docs from
the devs themselves would help - or the information being given to the
public is wrong. Non-v8/non-chrome devs saying false things about V8
performance isn't your fault, but it wouldn't hurt to try and prevent
that by publishing good information in textual form on the web.
I hope I'm not giving the impression that I think V8 is the only
problem here either; JS performance in general is a labyrinth. Based
on my experiences however, the best way to get info about V8
performance tuning is to talk to a Chromium dev directly or hunt down
YouTube videos of hour long presentations. This is pretty suboptimal
for a developer who's trying to tackle a performance issue in the
short term - Google is surprisingly bad at finding either of those two
info sources when you dig around or search for diagnostic messages.
I've personally been documenting everything concrete I learn about
this stuff on my wiki, but once I stop doing this day-to-day, all that
information will get outdated and mislead future developers. I think
that sucks, and the only good solution is for JS runtime devs to
provide concrete information on performance pitfalls and such in an
easily found location and keep it somewhat up to date. I don't think
you guys necessarily need to make --trace-deopt or --trace-bailout
super user friendly, but if you don't, there needs to be some basic
guidance out there for developers so that JS flags aren't their only
option for understanding Chrome performance.
Thanks for the info about c1visualizer - I bet the memory limit was
probably responsible for the flakiness and if I fiddle with JVM
parameters it might work. I'll give it another try later on.
-kg
> --
> v8-users mailing list
>
v8-u...@googlegroups.com
>
http://groups.google.com/group/v8-users
--
-kg