Browse Source

Benchmarks

v1.x
Tj Holowaychuk 14 years ago
parent
commit
5c78b367dd
  1. 4
      Readme.md
  2. 12
      benchmarks/run.js

4
Readme.md

@ -57,6 +57,10 @@ If not previously installed, you will want to install the [cairo graphics librar
A call to `Canvas#toBuffer()` will return a node `Buffer` instance containing all of the PNG data.
## Benchmarks
Although node-canvas is extremely now, and we have not even begun optimization yet it is already quite fast. For benchmarks vs other node canvas implementations view this [gist](https://gist.github.com/664922), or update the submodules and run `$ make benchmark` yourself.
## Contribute
Want to contribute to node-canvas? patches for features, bug fixes, documentation, examples and others are certainly welcome. Take a look at the [issue queue](https://github.com/LearnBoost/node-canvas/issues) for existing issues.

12
benchmarks/run.js

@ -75,6 +75,10 @@ bm('toBuffer() 200x200', 50, function(){
canvas.toBuffer();
});
bm('toBuffer().toString("base64") 200x200', 50, function(){
canvas.toBuffer().toString('base64');
});
bm('toDataURL() 200x200', 50, function(){
canvas.toDataURL();
});
@ -112,4 +116,12 @@ bm('o3 strokeRect()', function(){
o3ctx.strokeRect(50, 50, 100, 100);
});
bm('pngBuffer() 200x200', 50, function(){
o3ctx.pngBuffer();
});
bm('pngBuffer().toBase64() 200x200', 50, function(){
o3ctx.pngBuffer().toBase64();
});
console.log();

Loading…
Cancel
Save