Skip to content

Commit

Permalink
Tune benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
vovkasm committed Dec 16, 2016
1 parent e1d11a8 commit 7969f80
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions bench/bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,25 +86,18 @@ s.addDefaultRules({

const suite = new Benchmark.Suite()
let props
suite.add('plain props', function () {
const p = {style: {fontSize: 8}}
props = p
if (props.style.fontSize !== 8) {
throw new Error('fontSize != 8')
}
})
suite.add('new theme & props (cached)', function () {
suite.add('new theme & props', function () {
props = s.getProps('App AppView Elem Item Text', {prop1: 1})
if (props.style.fontSize !== 12) {
throw new Error('fontSize != 12')
}
s.cache = {}
})
suite.add('new theme & props (no cache)', function () {
suite.add('new theme & props (cached)', function () {
props = s.getProps('App AppView Elem Item Text', {prop1: 1})
if (props.style.fontSize !== 12) {
throw new Error('fontSize != 12')
}
s.cache = {}
})
suite.on('cycle', function (e) {
console.log(String(e.target))
Expand Down

0 comments on commit 7969f80

Please sign in to comment.