This file contains hidden or 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
<!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> |
This file contains hidden or 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
self = | |
{ | |
header: "Header", | |
header2: "Header2", | |
header3: "Header3", | |
header4: "Header4", | |
header5: "Header5", | |
header6: "Header6", | |
list: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] | |
}; |
This file contains hidden or 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
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++) |
This file contains hidden or 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
var Benchmark = require('benchmark') | |
var suite = new Benchmark.Suite | |
suite | |
.add('push', function () { | |
var a = [] | |
a.push("Lorem") | |
a.push("ipsum") | |
a.push("dolor") |
NewerOlder