Skip to content

Commit

Permalink
Merge pull request #361 from streamich/crdt-advanced-testing
Browse files Browse the repository at this point in the history
CRDT advanced testing
  • Loading branch information
streamich authored Oct 27, 2023
2 parents 0e03801 + ea9a168 commit 77a4ea0
Show file tree
Hide file tree
Showing 15 changed files with 460 additions and 428 deletions.
17 changes: 0 additions & 17 deletions src/json-crdt/__bench__/bench.random.js

This file was deleted.

16 changes: 16 additions & 0 deletions src/json-crdt/__bench__/bench.random.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* npx ts-node src/json-crdt/__bench__/bench.random.ts
*/

const iter = 1000e6;

let sum = 0;
const iteration = () => (sum += Math.random());

const t1 = performance.now();
for (let i = 0; i < iter; i++) iteration();
const t2 = performance.now();

// tslint:disable-next-line no-console
console.log('Result:', sum, 'Ops/sec:', (iter / ((t2 - t1) / 1000) / 1e6).toFixed(1), 'M');
// Result: 500002092.3119511 Ops/sec: 96.7 M
48 changes: 0 additions & 48 deletions src/json-crdt/__bench__/bench.traces.crdt-libs.js

This file was deleted.

25 changes: 25 additions & 0 deletions src/json-crdt/__bench__/bench.traces.crdt-libs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* npx ts-node src/json-crdt/__bench__/bench.traces.crdt-libs.ts
*/

import {runTraceMatrix} from './util/execute';

// prettier-ignore
runTraceMatrix({
traces: [
'friendsforever_flat',
'sveltecomponent',
'rustcode',
'seph-blog1',
'automerge-paper',
],
editors: [
'StringRga (json-joy)',
'json-joy',
// 'Y.js',
// 'Y.rs',
// 'AutomergeUnstable',
// 'Automerge',
],
iterationsPerEditor: 50,
});
40 changes: 0 additions & 40 deletions src/json-crdt/__bench__/bench.traces.non-crdt-libs.js

This file was deleted.

23 changes: 23 additions & 0 deletions src/json-crdt/__bench__/bench.traces.non-crdt-libs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* npx ts-node src/json-crdt/__bench__/bench.traces.non-crdt-libs.ts
*/

import {runTraceMatrix} from './util/execute';

// prettier-ignore
runTraceMatrix({
traces: [
'friendsforever_flat',
'sveltecomponent',
'rustcode',
'seph-blog1',
'automerge-paper',
],
editors: [
'StringRga (json-joy)',
'diamond-types-node',
'rope.js',
'V8 strings',
],
iterationsPerEditor: 50,
});
47 changes: 0 additions & 47 deletions src/json-crdt/__bench__/serialization-ids.js

This file was deleted.

23 changes: 0 additions & 23 deletions src/json-crdt/__bench__/timestamps.js

This file was deleted.

Loading

0 comments on commit 77a4ea0

Please sign in to comment.