Skip to content

Commit

Permalink
[jss] Add a benchmark for creating jss instances (#928)
Browse files Browse the repository at this point in the history
* Add a new benchmark for comparing creating instances with the preset and without it

* Improve suite name
  • Loading branch information
Henri authored Dec 6, 2018
1 parent db18b9f commit d565a26
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/jss/benchmark/tests/create-instance.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import {create} from 'jss'
import preset from 'jss-preset-default'

// Avoid memory leak with registry.
const options = {virtual: true}

suite('create a new instance', () => {
benchmark('without preset', () => {
create(options)
})

benchmark('with preset', () => {
create({
...options,
...preset()
})
})
})

0 comments on commit d565a26

Please sign in to comment.