Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mraleph
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
71 ms
·
241.
▲
by
mraleph
14y ago
I am not sure I entirely understand. If you are running in a cold code then performance does not matter and you can tolerate quickly allocating a small amount of boxes which will be as quickly reclaimed by scavenger once you are done with t
242.
▲
by
mraleph
14y ago
Optimized code can't deal with uint32 that is out of range so it deoptimizes and effectively you end up running in an entirely unoptimized code which is obviously much slower than optimized one... and of course this penalizes V8 even more
243.
▲
by
mraleph
14y ago
> This is most significant in V8 which does not use NaNboxing, so when it sees a big integer it makes it a boxed double NaN-tagging has nothing to do with the issue you are linking to e.g. in V8 does not allocate a boxed double for ev
244.
▲
by
mraleph
14y ago
Thanks for the update! I suggest you add a note to the text hinting that you are not using original tests anymore. It would be even cooler if you publish both results of original (polymorphic) and your (non-polymorphic) runs. I find results
245.
▲
by
mraleph
14y ago
You can use one Float32Array: x component gets even indices, y gets odd ones. The next standard might have a better binary data support: http://wiki.ecmascript.org/doku.php?id=harmony:binary_data I am not sure though where you tradeoffs b
246.
▲
by
mraleph
14y ago
I am not very familiar with internals of other engines. AFAIK both SpiderMonkey and Safari have polymorphic inline caches for a.foo property access sites. I can't say if the leverage PICs for a[i] access sites. But from what I see from a qu
247.
▲
by
mraleph
14y ago
Couple of things to be aware of from a V8 perspective: - to make "creation" test more fair for normal arrays they should be preallocated with new Array(arraySize), if arraySize does not exceed 90000. This will ensure that you are not wastin
248.
▲
by
mraleph
14y ago
It is hard to say: that's 2642 worth of revisions in V8. String (unicode) benchmark throughput was definitely greatly affected by improvements in string handling (both internal operations and writing then out of V8 heap through the API; V8
249.
▲
by
mraleph
15y ago
Dart _has_ first class functions: http://blog.sethladd.com/2011/12/learning-functions-for-dart... What Gilad describes is a way to make an instance of a class to behave like a function.
250.
▲
by
mraleph
15y ago
You should try Excelsior JET compiled Eclipse then. (see: http://www.excelsior-usa.com/ ) [disclaimer: I've worked for Excelsior LLC back then when initial support for AOT compilation of Eclipse was implemented]
251.
▲
by
mraleph
15y ago
It really depends on the semantics of those annotations. For example: how is v:Array.<int> enforced (and is it enforced at all)? Type annotations can be a good to seed type inference analysis or adjust collected type feedback. But u
252.
▲
by
mraleph
15y ago
yeah, I am sorry, I did not follow C naming etiquette to the letter. You are right: these days I am a bit accustomed to starting struct's names with a capital letter because I do a lot of C++ programming. (I would not call the struct POINT
253.
▲
by
mraleph
15y ago
emscripten generates very similar code from LLVM bitcode which in turn was generated (optimized) from say C or C++. It's next to impossible to emit such code from language that is not statically typed. Also it's not necessarily going to be
254.
▲
by
mraleph
15y ago
Well... You are underestimating the power of sweet spot :-) In a tight computation kernel it's actually possible for JavaScript or any other JIT compiled language given a good JIT to match the performance of C. Also mr. C and his boss came
255.
▲
by
mraleph
15y ago
Well I would not recommend writing code like mr. C to anyone. Unless you really-really-really need every last usec you can get :-) The goal was just to show that sometimes JS code generated by some tool sometimes can be faster than handwrit
256.
▲
by
mraleph
15y ago
Can you give more information about this? If you know that JS dev personally please ask him to file the bug ( http://code.google.com/p/v8/issues/entry ) or send any information he has about regressions to v8-users mailing list. I don't thin
257.
▲
by
mraleph
15y ago
> V8 team at Google I/O 2011 said they're at about the limit Can you please clarify who said that? As far as I know nobody from the V8 team was actually speaking at Google I/O 2011.
258.
▲
by
mraleph
15y ago
> A simple 1000x1000 matrix multiply in LuaJit is already 20x (not 2x!) faster than V8 and on par with C. You are using outdated measurements. Up to date results: http://attractivechaos.github.com/plb/plb-lang.png http://attractivech
259.
▲
by
mraleph
15y ago
> On top of it all, even V8 javascript still runs 10-20x slower than C. http://attractivechaos.github.com/plb/plb-lang.png http://attractivechaos.github.com/plb/plb-lib.png cross language comparions are bogus and their results can't
260.
▲
by
mraleph
15y ago
I am a bit curious about it's performance characteristics (e.g. number of node.js instances launched, method of load balancing, etc). Do you experience any problems with GC?
261.
▲
by
mraleph
15y ago
There are a public issue tracker and v8-users mailing list. If somebody is experiencing problems with GC then they should stop by and ask or file an issue or submit a benchmark/testcase...
262.
▲
by
mraleph
15y ago
Creating a new V8 Context when V8 is compiled with snapshots is ~2 ms on a decent hardware. But it's still too long for node.js needs: the idea was to create an isolated world per request. Yes, you can spawn a context faster if you strip ou
263.
▲
by
mraleph
15y ago
> Also, due to V8's poor C++ API, msgpack doesn't support deserialization of 64 bit integers. JavaScript _does_not_ have a number type wide enough to hold 64-bit integer. V8 API has nothing to do with it.
264.
▲
by
mraleph
15y ago
the technique is called "inline caching". "tracing" is a completely different approach to JITs.
265.
▲
by
mraleph
15y ago
Arguments misuse will ruin performance if the code is hot.
266.
▲
by
mraleph
15y ago
> especially if it is used out of bounds. Fortunately in EventEmitter.prototype.emit it was never used out-of-bounds. > I wonder if this true for all pseudo-arrays? Arguments object has a very special semantics. It is
267.
▲
by
mraleph
15y ago
> if you emit Spidermonkey/Hydrogen bytecode Hydrogen is not a bytecode, it is highlevel intermediate representation for optimizing compiler generated from AST. There is currently: 1) no frontend in V8 that accepts hydrogen in some seri
268.
▲
by
mraleph
15y ago
> Where does ToNumber come from? It sounds like the kind of thing that ought to get optimized! ToNumber comes from Number(l). I can't see how it can be optimized (l is a string so parsing is unavoidable). > You mean, if you use dele
269.
▲
by
mraleph
15y ago
The idea "in hot code" slides try to express is very simple: if you have a JavaScript function that should run as fast as possible then don't do this and that. Going into details requires a lot of speaking/writing so it was not an option fo
270.
▲
by
mraleph
15y ago
1. V8 does not perform tail call elimination (AFAIK none of the major JS VMs perform it) because certain legacy JS language features (namely func.arguments and similar) are not TCE-friendly (see for more details http://code.google.com/p/v8
More ›