3 ms·
Can you elaborate on your claim that Dart designers optimized Delta Blue when porting it to Dart? Here's the Dart code for Delta Blue: https://github.com/dart-
by sethladd 13y ago
Can you elaborate on your claim that Dart designers optimized Delta Blue when porting it to Dart?
Here's the Dart code for Delta Blue: https://github.com/dart-lang/benchmark_harness/blob/master/example/DeltaBlue.dart https://github.com/dart-lang/benchmark_harness/blob/master/e...
Here's the JavaScript code for Delta Blue: https://code.google.com/p/v8/source/browse/branches/bleeding_edge/benchmarks/deltablue.js https://code.google.com/p/v8/source/browse/branches/bleeding...
I see a JS class for Constraint, and a Dart class for Constraint.
I see a JS class for Strength, and a Dart class for Strength.
This goes on and on. In fact, I see a top-level function for chainTest() in both JavaScript and Dart.
- bsdetector 13y agoRemove OrderedCollection from JavaScript or add it to Dart, then compare. This extra level of indirection on every container is very costly in V8 and Ion. At least four of your coworkers are aware of this. They should have communicated it to you a long time ago.
- mraleph 13y ago> This extra level of indirection on every container is very costly in V8 and Ion. It is very costly only if JIT is particularly bad at eliminating redundancies. Crankshaft is not and (I hope) neither is IonMonkey. If you try removing it yourself from JavaScript version and replace every new OrderedCollection() with [], .add with .push, and so on then you will discover to your amazement that resulting code became 7-10% slower on V8 [try it, I am not joking :-)] Now if you replace [] with new Array() then you get code that overall is 3-5% faster on V8. That is about how "costly" this indirection is. Overall it seems that this is irrelevant in the large picture of things: Dart VM is around 195% of V8, dart2js is somewhere around 100%. I do agree however that this OrderedCollection looks completely out of place and it is not clear to me why it appeared in the original JavaScript benchmark code at the first place. It is not idiomatic.
- bsdetector 13y ago> you will discover to your amazement that resulting code became 7-10% slower on V8 I found both V8 and Ion to be >10% faster using array. I no longer have the results but IIRC it was 11% for V8 and 14% for Ion on i7 (ivy bridge). I moved remove() from OrderedCollection to Array prototype. Perhaps you made some other change. > Overall it seems that this is irrelevant in the large picture of things: Dart VM is around 195% of V8, There are 3 benchmarks. That is not enough data to say anything meaningful about Dart VM performance. > dart2js is somewhere around 100%. How can dart2js results be compared to the original JS if the data structures used are different? It makes no sense.
- mraleph 13y ago> Perhaps you made some other change. I tried with both global remove and remove on the Array prototype. V8 has recently improved DeltaBlue score by, I think, ~6% so it can be that before this improvement OrderedCollection overhead was more noticeable. (some of that improvement comes from tweaks in the inlining heuristics AFAIK). > There are 3 benchmarks. I was stating performance numbers for DeltaBlue only. Sorry for not being clear. > How can dart2js results be compared to the original JS if the data structures used are different? Substract 5%. dart2js is around 95%. Does it make sense now?