Navigation Menu

Skip to content

Commit

Permalink
Check in cpp-boundary benchmarks
Browse files Browse the repository at this point in the history
The results for pure JS could still be 5 times faster if I figure out
wtf is going on in v8.
  • Loading branch information
felixge committed Oct 3, 2012
1 parent bf6ff55 commit 3c797a9
Show file tree
Hide file tree
Showing 18 changed files with 340 additions and 0 deletions.
4 changes: 4 additions & 0 deletions figures/cpp-boundary/Makefile
@@ -0,0 +1,4 @@
SHELL := /bin/bash
benchmarks = js cpp

include ../common.mk
8 changes: 8 additions & 0 deletions figures/cpp-boundary/benchmark/binding.gyp
@@ -0,0 +1,8 @@
{
"targets": [
{
"target_name": "cpp",
"sources": [ "cpp.cc" ]
}
]
}
17 changes: 17 additions & 0 deletions figures/cpp-boundary/benchmark/cpp.cc
@@ -0,0 +1,17 @@
#include <node.h>
#include <v8.h>

using namespace v8;

Handle<Value> TwentyThree(const Arguments& args) {
HandleScope scope;
return scope.Close(Number::New(23));
}

void init(Handle<Object> target) {
target->Set(
String::NewSymbol("twentyThree"),
FunctionTemplate::New(TwentyThree)->GetFunction()
);
}
NODE_MODULE(cpp, init)
1 change: 1 addition & 0 deletions figures/cpp-boundary/benchmark/cpp.js
@@ -0,0 +1 @@
module.exports = require('./build/Release/cpp');
3 changes: 3 additions & 0 deletions figures/cpp-boundary/benchmark/js.js
@@ -0,0 +1,3 @@
exports.twentyThree = function() {
return 23;
};
14 changes: 14 additions & 0 deletions figures/cpp-boundary/benchmark/run.js
@@ -0,0 +1,14 @@
#!/usr/bin/env node

var common = require('../../common');
var libName = process.argv[2];
var lib = require('./' + libName);
var loopCount = 50000000;

common.run(libName, loopCount, function() {
for (var i = 0; i < loopCount; i++) {
if (lib.twentyThree() !== 23) {
new Error('failed assert');
}
}
});
Binary file added figures/cpp-boundary/pdfs/heap-total-line.pdf
Binary file not shown.
Binary file added figures/cpp-boundary/pdfs/heap-used-line.pdf
Binary file not shown.
Binary file added figures/cpp-boundary/pdfs/jitter.pdf
Binary file not shown.
Binary file added figures/cpp-boundary/pdfs/line.pdf
Binary file not shown.
Binary file added figures/cpp-boundary/pdfs/old-jitter.pdf
Binary file not shown.
Binary file added figures/cpp-boundary/pngs/heap-total-line.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/cpp-boundary/pngs/heap-used-line.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/cpp-boundary/pngs/jitter.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/cpp-boundary/pngs/line.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/cpp-boundary/pngs/old-jitter.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions figures/cpp-boundary/results/cpp.tsv
@@ -0,0 +1,29 @@
name hz time rss heapUsed heapTotal nodeVersion v8Version
cpp 22696323 1349264454888 12079104 2352272 4050688 0.8.11 3.11.10.22
cpp 22686025 1349264457097 13496320 2504784 6131200 0.8.11 3.11.10.22
cpp 22696323 1349264459301 13500416 2510536 6131200 0.8.11 3.11.10.22
cpp 22696323 1349264461506 13778944 2382712 6131200 0.8.11 3.11.10.22
cpp 22655188 1349264463715 12730368 2359808 5082624 0.8.11 3.11.10.22
cpp 22675737 1349264465920 12730368 2362824 5082624 0.8.11 3.11.10.22
cpp 22644928 1349264468128 12730368 2364736 5082624 0.8.11 3.11.10.22
cpp 22624434 1349264470341 12419072 2325504 5082624 0.8.11 3.11.10.22
cpp 22542831 1349264472559 12419072 2327544 5082624 0.8.11 3.11.10.22
cpp 22451729 1349264474786 12423168 2329456 5082624 0.8.11 3.11.10.22
cpp 22212350 1349264477039 12431360 2325568 5082624 0.8.11 3.11.10.22
cpp 22747953 1349264479237 12443648 2327608 5082624 0.8.11 3.11.10.22
cpp 22696323 1349264481440 12447744 2329552 5082624 0.8.11 3.11.10.22
cpp 22716947 1349264483643 12443648 2325544 5082624 0.8.11 3.11.10.22
cpp 22512382 1349264485864 12443648 2327584 5082624 0.8.11 3.11.10.22
cpp 22573363 1349264488080 12447744 2329496 5082624 0.8.11 3.11.10.22
cpp 22706630 1349264490284 12500992 2322672 6131200 0.8.11 3.11.10.22
cpp 22716947 1349264492486 12500992 2327688 6131200 0.8.11 3.11.10.22
cpp 22532672 1349264494705 12500992 2329944 6131200 0.8.11 3.11.10.22
cpp 22706630 1349264496909 12505088 2323416 6131200 0.8.11 3.11.10.22
cpp 22737608 1349264499108 12505088 2325936 6131200 0.8.11 3.11.10.22
cpp 22675737 1349264501314 12505088 2327856 6131200 0.8.11 3.11.10.22
cpp 22624434 1349264503524 12505088 2346496 6131200 0.8.11 3.11.10.22
cpp 22727273 1349264505724 12505088 2348512 6131200 0.8.11 3.11.10.22
cpp 22727273 1349264507924 12509184 2350432 6131200 0.8.11 3.11.10.22
cpp 22747953 1349264510122 12509184 2352352 6131200 0.8.11 3.11.10.22
cpp 22706630 1349264512325 12513280 2354336 6131200 0.8.11 3.11.10.22
cpp 22614202 1349264514536 12513280 2356256 6131200 0.8.11 3.11.10.22
264 changes: 264 additions & 0 deletions figures/cpp-boundary/results/js.tsv

Large diffs are not rendered by default.

0 comments on commit 3c797a9

Please sign in to comment.