Skip to content

Commit

Permalink
Merge pull request #86 from gadget-inc/measure-mobx-perf
Browse files Browse the repository at this point in the history
Add some benchmarks to test mobx-state-tree instantiation
  • Loading branch information
thegedge committed May 9, 2024
2 parents 918bddd + 5f815aa commit 5f3020f
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions bench/all.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Suite } from "benchmark";
import { withCodSpeed } from "@codspeed/benchmark.js-plugin";
import { Suite } from "benchmark";
import findRoot from "find-root";
import fs from "fs";
import { LargeRoot } from "../spec/fixtures/LargeRoot";
import { FruitAisle } from "../spec/fixtures/FruitAisle";
import { LargeRoot } from "../spec/fixtures/LargeRoot";
import { TestClassModel } from "../spec/fixtures/TestClassModel";
import { BigTestModelSnapshot, TestModelSnapshot } from "../spec/fixtures/TestModel";

Expand All @@ -25,6 +25,18 @@ void suite
.add("instantiating a diverse root", function () {
TestClassModel.createReadOnly(BigTestModelSnapshot);
})
.add("instantiating a small root (mobx-state-tree)", function () {
TestClassModel.create(TestModelSnapshot);
})
.add("instantiating a large root (mobx-state-tree)", function () {
LargeRoot.create(largeRoot);
})
.add("instantiating a large union (mobx-state-tree)", function () {
FruitAisle.create(fruitAisle);
})
.add("instantiating a diverse root (mobx-state-tree)", function () {
TestClassModel.create(BigTestModelSnapshot);
})
.on("start", function () {
console.profile();
})
Expand Down

0 comments on commit 5f3020f

Please sign in to comment.