Skip to content

Commit 932959b

Browse files
committed
chore: set performance bar
1 parent 38bf0a5 commit 932959b

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

test/unit/reducers/cacheReducer.spec.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,8 +1803,7 @@ describe('cacheReducer', () => {
18031803
expect(pass3.cache.databaseOverrides[collection]).to.eql();
18041804
});
18051805
});
1806-
1807-
describe('Speed test', () => {
1806+
describe('Speed test (on 2015 Dual-core 1.5Ghz i5 w/ 8GB 1600 DDR3)', () => {
18081807
let namespaces;
18091808
before(() => {
18101809
namespaces = debug.disable();
@@ -1813,7 +1812,7 @@ describe('cacheReducer', () => {
18131812
if (namespaces) debug.enable(namespaces);
18141813
});
18151814

1816-
it('<16ms processing large action and large state', async function () {
1815+
it('<36ms processing large action and large state', async function () {
18171816
// eslint-disable-next-line no-invalid-this
18181817
this.timeout(5_000);
18191818

@@ -1822,13 +1821,14 @@ describe('cacheReducer', () => {
18221821
await benchmark.record(
18231822
() => manyActions.forEach((action) => reducer(appState, action)),
18241823
{
1825-
iterations: 20,
1826-
meanUnder: 20,
1824+
iterations: 90,
1825+
meanUnder: 36,
1826+
standardDeviationUnder: 10,
18271827
},
18281828
);
18291829
});
18301830

1831-
it('<16ms to process stores 2,000 docs', async function () {
1831+
it('<18ms to process stores 2,000 docs', async function () {
18321832
// eslint-disable-next-line no-invalid-this
18331833
this.timeout(5_000);
18341834

@@ -1852,11 +1852,11 @@ describe('cacheReducer', () => {
18521852

18531853
await benchmark.record(() => reducer(appState, action), {
18541854
iterations: 50,
1855-
meanUnder: 16,
1855+
meanUnder: 18,
18561856
});
18571857
});
18581858

1859-
it('<16ms to process 100 mutates', async function () {
1859+
it('<24ms to process 100 mutates', async function () {
18601860
// eslint-disable-next-line no-invalid-this
18611861
this.timeout(5_000);
18621862

@@ -1879,19 +1879,19 @@ describe('cacheReducer', () => {
18791879
await benchmark.record(
18801880
() => manyActions.forEach((action) => reducer(appState, action)),
18811881
{
1882-
iterations: 50,
1883-
meanUnder: 16,
1882+
iterations: 125,
1883+
meanUnder: 24,
18841884
},
18851885
);
18861886
});
18871887

1888-
it('<2ms to process 1MB action', async function () {
1888+
it('<4ms to process 1MB action', async function () {
18891889
// eslint-disable-next-line no-invalid-this
18901890
this.timeout(5_000);
18911891

18921892
await benchmark.record(() => reducer(primedState, largeAction), {
1893-
iterations: 50,
1894-
meanUnder: 2,
1893+
iterations: 1_000,
1894+
meanUnder: 4,
18951895
});
18961896
});
18971897
});

0 commit comments

Comments
 (0)