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
3 changes: 2 additions & 1 deletion benchmarks/src/cluster.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { fork } from 'node:child_process'
import * as path from 'node:path'
import { createClient } from 'redis'
import postgres from 'postgres'
import * as promise from 'lib0/promise'
Expand All @@ -14,7 +15,7 @@ import { sumProcessMetrics } from './metrics.js'
* so a full sweep does not pay a boot per row.
*/

const hubEntry = new URL('./proc/hub.js', import.meta.url).pathname
const hubEntry = path.join(import.meta.dirname, 'proc/hub.js')

/**
* @param {any} child
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as path from 'node:path'
import config from './config.js'
import { Reporter, freeDiskGiB } from './report.js'
import { stopCluster, reclaimStorage, takeTaskFailures } from './cluster.js'
Expand Down Expand Up @@ -89,7 +90,7 @@ const run = async () => {
}
}
await stopCluster()
const outPath = new URL('../' + config.run.outFile, import.meta.url).pathname
const outPath = path.join(import.meta.dirname, '..', config.run.outFile)
report.write(outPath, derivedSection(report))
}

Expand Down
3 changes: 2 additions & 1 deletion benchmarks/src/suites/y1-primitives.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { fork } from 'node:child_process'
import * as path from 'node:path'
import * as Y from '@y/y'
import * as promise from 'lib0/promise'
import { mergeUpdates } from '../../../src/y-utils.js'
Expand Down Expand Up @@ -91,7 +92,7 @@ export const runY14 = () => {
* cannot be made inside one process.
*/
const runNative = () => promise.create((resolve, reject) => {
const child = fork(new URL('../proc/y-native.js', import.meta.url).pathname, [], {
const child = fork(path.join(import.meta.dirname, '../proc/y-native.js'), [], {
env: { ...process.env, USE_Y_NATIVE: '1' },
execArgv: ['--expose-gc', '--max-old-space-size=8192'],
stdio: ['ignore', 'inherit', 'inherit', 'ipc']
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/src/trace.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as fs from 'node:fs'
import * as path from 'node:path'
import * as decoding from 'lib0/decoding'
import config from './config.js'

Expand All @@ -19,7 +20,7 @@ import config from './config.js'
* @typedef {{ type: string, updateFormat: string, gc: boolean, source: any, users: Array<string>, totalBytes: number, updates: Array<TraceStep> }} Trace
*/

const tracePath = new URL(`../${config.trace.file}`, import.meta.url).pathname
const tracePath = path.join(import.meta.dirname, '..', config.trace.file)

export const traceAvailable = () => fs.existsSync(tracePath)

Expand Down