Skip to content

Instantly share code, notes, and snippets.

@saabi
saabi / bench.js
Created May 10, 2012 01:03 — forked from eldargab/bench.js
Benchmark str concatenation
var Benchmark = require('benchmark')
var suite = new Benchmark.Suite
suite
.add('push', function () {
var a = []
a.push("Lorem")
a.push("ipsum")
a.push("dolor")
@saabi
saabi / bench.js
Created May 10, 2012 01:25 — forked from chowey/bench.js
Benchmark str concatenation
var Benchmark = require('benchmark');
var suite = new Benchmark.Suite,
a, b;
global.str = 'TextTextTextTextTextTextTextTextTextTextTextTextTextTextText\n';
global.str2 = 'TextTextTextTextTextTextTextTextTextTextTextTextTextTextText\\n';
var statement = 'var str = global.str;\nvar s=';
for (i=0; i<100; i++)
@saabi
saabi / index.html
Created December 8, 2016 21:10 — forked from Spyryto/index.html
For loop benchmark (http://jsbench.github.io/#67b13d4e78cdd0d7a7346410d5becf12) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>For loop benchmark</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>