Permalink
Browse files

Update

  • Loading branch information...
1 parent 3e45c48 commit ff07a322787c81fbbcfe5721e1e0cfae0a8b1cbe @felixge committed Oct 3, 2012
View
@@ -2,52 +2,43 @@ var duration = 90 * 1000;
exports.run = function(name, benchmark) {
var startup = Date.now();
- var start;
var number = 0;
- function callback(err, extra) {
- var duration = Date.now() - start;
+ function run() {
+ if (startup + duration < Date.now()) {
+ return;
+ }
- if (err) throw err;
+ var start = Date.now();
+ benchmark(function (err, extra) {
+ var duration = Date.now() - start;
- var memory = process.memoryUsage();
- var versions = process.versions;
+ if (err) throw err;
- var results = {
- benchmark : name,
- number : ++number,
- duration : duration,
- time : Date.now(),
- rss : memory.rss,
- heapUsed : memory.heapUsed,
- heapTotal : memory.heapTotal,
- nodeVersion : process.versions.node,
- v8Version : process.versions.v8,
- };
+ var memory = process.memoryUsage();
+ var versions = process.versions;
- for (var key in extra) {
- results[key] = extra[key];
- }
+ var results = {
+ benchmark : name,
+ number : ++number,
+ duration : duration,
+ time : Date.now(),
+ rss : memory.rss,
+ heapUsed : memory.heapUsed,
+ heapTotal : memory.heapTotal,
+ nodeVersion : process.versions.node,
+ v8Version : process.versions.v8,
+ };
- print(results);
+ for (var key in extra) {
+ results[key] = extra[key];
+ }
- process.nextTick(run);
- };
+ print(results);
- function run() {
- if (startup + duration < Date.now()) {
- return;
- }
-
- if (benchmark.length > 0) {
- start = Date.now();
- benchmark(callback);
- } else {
- start = Date.now();
- benchmark();
- callback(null);
- }
+ process.nextTick(run);
+ });
}
run();
Binary file not shown.
@@ -5,10 +5,12 @@ var libName = process.argv[2];
var lib = require('./' + libName);
var loopCount = 50000000;
-common.run(libName, loopCount, function() {
+common.run(libName, function(cb) {
for (var i = 0; i < loopCount; i++) {
if (lib.twentyThree() !== 23) {
new Error('failed assert');
}
}
+
+ cb(null, {count: loopCount});
});
Binary file not shown.
@@ -0,0 +1,49 @@
+#!/usr/bin/env RScript
+
+library(ggplot2)
+library(scales)
+
+outputWidth=8
+outputHeight=6
+
+files <- Sys.glob("results/*.tsv")
+
+results <- lapply(files, function(.file){
+ .in <- read.table(.file, sep="\t", header=T)
+ .in$time = ISOdatetime(1970,1,1,0,0,0) + .in$time / 1000
+ .in$hz = .in$count / (.in$duration / 1000)
+ .in
+})
+
+results <- do.call(rbind, results)
+
+## Jitter Graph
+p <- ggplot(results, aes(benchmark, hz, color=benchmark))
+p <- p + scale_y_log10()
+p + geom_jitter()
+
+ggsave(filename="pdfs/jitter.pdf", width=outputWidth, height=outputHeight)
+
+# Line graph
+p <- ggplot(results, aes(time, hz, color=benchmark))
+p <- p + scale_y_continuous(label=comma_format())
+p <- p + scale_x_datetime(label=date_format("%H:%M:%S"))
+p + geom_line()
+
+ggsave(filename="pdfs/line.pdf", width=outputWidth, height=outputHeight)
+
+# Heap Used
+p <- ggplot(results, aes(time, heapUsed / 1024 / 1024, color=benchmark))
+p <- p + labs(y = "Heap Used (MB)")
+p <- p + scale_x_datetime(label=date_format("%H:%M:%S"))
+p + geom_line()
+
+ggsave(filename="pdfs/heap-used-line.pdf", width=outputWidth, height=outputHeight)
+
+# Heap Total
+p <- ggplot(results, aes(time, heapTotal / 1024 / 1024, color=benchmark))
+p <- p + labs(y = "Heap Total (MB)")
+p <- p + scale_x_datetime(label=date_format("%H:%M:%S"))
+p + geom_line()
+
+ggsave(filename="pdfs/heap-total-line.pdf", width=outputWidth, height=outputHeight)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,29 +1,41 @@
-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
+benchmark number duration time rss heapUsed heapTotal nodeVersion v8Version count
+cpp 1 2276 1349271522521 12132352 2353864 5082624 0.8.11 3.11.10.22 50000000
+cpp 2 2275 1349271524801 13524992 2507136 6131200 0.8.11 3.11.10.22 50000000
+cpp 3 2277 1349271527078 13529088 2513144 6131200 0.8.11 3.11.10.22 50000000
+cpp 4 2291 1349271529371 13811712 2383992 6131200 0.8.11 3.11.10.22 50000000
+cpp 5 2283 1349271531656 12775424 2360624 5082624 0.8.11 3.11.10.22 50000000
+cpp 6 2274 1349271533930 12775424 2364152 5082624 0.8.11 3.11.10.22 50000000
+cpp 7 2278 1349271536208 12775424 2366544 5082624 0.8.11 3.11.10.22 50000000
+cpp 8 2277 1349271538487 12460032 2326384 5082624 0.8.11 3.11.10.22 50000000
+cpp 9 2281 1349271540768 12460032 2328936 5082624 0.8.11 3.11.10.22 50000000
+cpp 10 2284 1349271543052 12464128 2331328 5082624 0.8.11 3.11.10.22 50000000
+cpp 11 2276 1349271545330 12460032 2326424 5082624 0.8.11 3.11.10.22 50000000
+cpp 12 2278 1349271547608 12460032 2329008 5082624 0.8.11 3.11.10.22 50000000
+cpp 13 2277 1349271549886 12464128 2331432 5082624 0.8.11 3.11.10.22 50000000
+cpp 14 2277 1349271552165 12460032 2326464 5082624 0.8.11 3.11.10.22 50000000
+cpp 15 2276 1349271554441 12460032 2329048 5082624 0.8.11 3.11.10.22 50000000
+cpp 16 2279 1349271556720 12464128 2331472 5082624 0.8.11 3.11.10.22 50000000
+cpp 17 2288 1349271559010 12517376 2323472 6131200 0.8.11 3.11.10.22 50000000
+cpp 18 2276 1349271561286 12517376 2329032 6131200 0.8.11 3.11.10.22 50000000
+cpp 19 2277 1349271563563 12517376 2331800 6131200 0.8.11 3.11.10.22 50000000
+cpp 20 2279 1349271565844 12521472 2324200 6131200 0.8.11 3.11.10.22 50000000
+cpp 21 2276 1349271568120 12521472 2327264 6131200 0.8.11 3.11.10.22 50000000
+cpp 22 2278 1349271570398 12521472 2329696 6131200 0.8.11 3.11.10.22 50000000
+cpp 23 2288 1349271572686 12521472 2349576 6131200 0.8.11 3.11.10.22 50000000
+cpp 24 2292 1349271574978 12525568 2352072 6131200 0.8.11 3.11.10.22 50000000
+cpp 25 2281 1349271577259 12529664 2354536 6131200 0.8.11 3.11.10.22 50000000
+cpp 26 2282 1349271579541 12529664 2357000 6131200 0.8.11 3.11.10.22 50000000
+cpp 27 2283 1349271581824 12533760 2359496 6131200 0.8.11 3.11.10.22 50000000
+cpp 28 2282 1349271584106 12533760 2361960 6131200 0.8.11 3.11.10.22 50000000
+cpp 29 2282 1349271586388 12537856 2364360 6131200 0.8.11 3.11.10.22 50000000
+cpp 30 2298 1349271588686 12541952 2366856 6131200 0.8.11 3.11.10.22 50000000
+cpp 31 2282 1349271590968 12541952 2369320 6131200 0.8.11 3.11.10.22 50000000
+cpp 32 2282 1349271593251 12546048 2371720 6131200 0.8.11 3.11.10.22 50000000
+cpp 33 2288 1349271595539 12546048 2374216 6131200 0.8.11 3.11.10.22 50000000
+cpp 34 2280 1349271597819 12550144 2376648 6131200 0.8.11 3.11.10.22 50000000
+cpp 35 2277 1349271600096 12550144 2379112 6131200 0.8.11 3.11.10.22 50000000
+cpp 36 2286 1349271602382 12554240 2381776 6131200 0.8.11 3.11.10.22 50000000
+cpp 37 2280 1349271604662 12558336 2384240 6131200 0.8.11 3.11.10.22 50000000
+cpp 38 2286 1349271606949 12558336 2386704 6131200 0.8.11 3.11.10.22 50000000
+cpp 39 2275 1349271609225 12562432 2389168 6131200 0.8.11 3.11.10.22 50000000
+cpp 40 2279 1349271611504 12562432 2391632 6131200 0.8.11 3.11.10.22 50000000
Oops, something went wrong.

0 comments on commit ff07a32

Please sign in to comment.