Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The results for pure JS could still be 5 times faster if I figure out wtf is going on in v8.
- Loading branch information
Showing
18 changed files
with
340 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,4 @@ | |||
SHELL := /bin/bash | |||
benchmarks = js cpp | |||
|
|||
include ../common.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,8 @@ | |||
{ | |||
"targets": [ | |||
{ | |||
"target_name": "cpp", | |||
"sources": [ "cpp.cc" ] | |||
} | |||
] | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
module.exports = require('./build/Release/cpp'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,3 @@ | |||
exports.twentyThree = function() { | |||
return 23; | |||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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 not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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 |
Large diffs are not rendered by default.
Oops, something went wrong.