Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions JetStreamDriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -2085,6 +2085,17 @@ let BENCHMARKS = [
deterministicRandom: true,
tags: ["Default", "ThreeJs"],
}),
new AsyncBenchmark({
name: "mobx-startup",
files: [
"./startup-helper/StartupBenchmark.js",
"./mobx/benchmark.js",
],
preload:{
BUNDLE: "./mobx/dist/bundle.es6.min.js",
},
tags: ["Default", "mobx", "startup"],
}),
// Wasm
new WasmEMCCBenchmark({
name: "HashSet-wasm",
Expand Down
7 changes: 7 additions & 0 deletions mobx/benchmark-node.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { runTest } from "./src/test.mjs";

const then = performance.now();
runTest();
const duration = performance.now() - then;

console.log(`Duration : ${duration.toFixed(2)}ms`);
52 changes: 52 additions & 0 deletions mobx/benchmark.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Copyright (C) 2025 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

const EXPECTED_LOG_LENGTH = 6824;

class Benchmark extends StartupBenchmark {
lastResult;

constructor(iterationCount) {
super({
iterationCount,
expectedCacheCommentCount: 464,
sourceCodeReuseCount: 8,
});
}

runIteration(iteration) {
// Module is loaded into PrismJSBenchmark
let MobXBenchmark;
eval(this.iterationSourceCodes[iteration]);
this.lastResult = MobXBenchmark.runTest();
}

validate() {
console.assert(
this.lastResult.length === EXPECTED_LOG_LENGTH,
`Expected this.lastResult.length to be ${EXPECTED_LOG_LENGTH}, but got ${this.lastResult.length}`
);
}
}
930 changes: 930 additions & 0 deletions mobx/dist/bundle.es5.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions mobx/dist/bundle.es5.js.map

Large diffs are not rendered by default.

930 changes: 930 additions & 0 deletions mobx/dist/bundle.es5.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions mobx/dist/bundle.es5.min.js.map

Large diffs are not rendered by default.

930 changes: 930 additions & 0 deletions mobx/dist/bundle.es6.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions mobx/dist/bundle.es6.js.map

Large diffs are not rendered by default.

930 changes: 930 additions & 0 deletions mobx/dist/bundle.es6.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions mobx/dist/bundle.es6.min.js.map

Large diffs are not rendered by default.

Loading
Loading