Skip to content

Commit

Permalink
Update benchmarks page, README
Browse files Browse the repository at this point in the history
  • Loading branch information
nebrelbug committed Feb 27, 2020
1 parent e9bd59a commit a93cd9b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# squirrelly

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[logo]: https://img.shields.io/badge/all_contributors-3-orange.svg 'Number of contributors on All-Contributors'

[logo]: https://img.shields.io/badge/all_contributors-3-orange.svg "Number of contributors on All-Contributors"

<!-- ALL-CONTRIBUTORS-BADGE:END -->

![GitHub package.json version (master)](https://img.shields.io/github/package-json/v/squirrellyjs/squirrelly/master?label=current%20version)
Expand Down Expand Up @@ -48,7 +50,8 @@ Simply put, Squirrelly is super lightweight, super fast, super powerful, and sup
- 🔧 Inline JavaScript
- 🔨 Comments
- 🔧 Caching
- 🚀 Fast
- 🚀 Super Fast
- Squirrelly [has been benchmarked](https://github.com/nebrelbug/squirrelly-benchmarks/tree/v8) against Marko, Pug, doT, Swig, Handlebars, Mustache, and Nunjucks. In each test, Squirrelly was fastest.
- ⚡️ Async support: async filters, helpers, partials
- 🔧 Template inheritance

Expand Down Expand Up @@ -118,6 +121,7 @@ Made with ❤ by [@nebrelbug](https://github.com/nebrelbug) and all these wonder

<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind are welcome!
Expand Down
19 changes: 12 additions & 7 deletions browser-tests/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,11 @@ var runTest = function (callback) {
})

var Timer = function () {
this.startTime = +new Date()
this.startTime = window.performance.now()
}

Timer.prototype.stop = function () {
return +new Date() - this.startTime
return window.performance.now() - this.startTime
}

var colors = Highcharts.getOptions().colors
Expand Down Expand Up @@ -394,7 +394,7 @@ var runTest = function (callback) {

tooltip: {
formatter: function () {
return '<b>' + this.x + '</b><br/>' + this.y + 'ms'
return '<b>' + this.x + '</b><br/>' + this.y + ' ops/sec'
}
},

Expand All @@ -406,7 +406,7 @@ var runTest = function (callback) {
dataLabels: {
enabled: true,
formatter: function () {
return this.y + 'ms'
return this.y + ' ops/sec'
}
}
}
Expand All @@ -418,15 +418,18 @@ var runTest = function (callback) {
]
})

var tester = function (target) {
function tester (target) {
var time = new Timer()
var html = target.tester()
console.log(target.name + '------------------\n', html)
var endTime = time.stop()
console.log(target.name + '------------------\n', html)

var timeInSecs = endTime / 1000
var opsPerSec = Math.round(config.calls / timeInSecs)

chart.series[0].addPoint({
color: colors.shift(),
y: endTime
y: opsPerSec
})

if (!list.length) {
Expand Down Expand Up @@ -463,6 +466,8 @@ window['app'] = function (selector) {
<em>Note: originally, Art-template's benchmarking page only benchmarked the template function after it was compiled. This benchmark includes compilation and rendering.</em>
<br><br>
<em>Note: 'Squirrelly - Fast' uses a Squirrelly template with native code tags instead of the builtin helper.</em>
<br><br>
<strong>Longer (more ops/sec) is better</strong>
<div class="header">
<p class="item">
Expand Down

0 comments on commit a93cd9b

Please sign in to comment.