From 3759420a344469a5f416ba27078e69b71b0fdee3 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Mon, 8 Nov 2010 08:47:10 -0800 Subject: [PATCH] More benchmarks --- benchmarks/run.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/benchmarks/run.js b/benchmarks/run.js index 795f4c6..451c86d 100644 --- a/benchmarks/run.js +++ b/benchmarks/run.js @@ -6,8 +6,10 @@ var Canvas = require('../lib/canvas') , canvasFactory = require('./node-o3-canvas/lib/o3-canvas') , canvas = new Canvas(200, 200) + , largeCanvas = new Canvas(1000, 1000) , ctx = canvas.getContext('2d') - , o3ctx = canvasFactory(200,200,'argb'); + , o3ctx = canvasFactory(200,200,'argb') + , o3ctxLarge = canvasFactory(1000,1000,'argb'); var times = 10000; @@ -75,6 +77,10 @@ bm('toBuffer() 200x200', 50, function(){ canvas.toBuffer(); }); +bm('toBuffer() 1000x1000', 50, function(){ + largeCanvas.toBuffer(); +}); + bm('toBuffer().toString("base64") 200x200', 50, function(){ canvas.toBuffer().toString('base64'); }); @@ -120,6 +126,10 @@ bm('pngBuffer() 200x200', 50, function(){ o3ctx.pngBuffer(); }); +bm('pngBuffer() 1000x1000', 50, function(){ + o3ctxLarge.pngBuffer(); +}); + bm('pngBuffer().toBase64() 200x200', 50, function(){ o3ctx.pngBuffer().toBase64(); });