Skip to content

Commit

Permalink
perf: use node: prefix to bypass require.cache call for builtins (#111
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs authored Sep 10, 2023
1 parent 81a379b commit 9b4835c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions benchmarks/run.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict'

const { writeFileSync, openSync, closeSync } = require('fs')
const { spawn } = require('child_process')
const { resolve, join } = require('path')
const { writeFileSync, openSync, closeSync } = require('node:fs')
const { spawn } = require('node:child_process')
const { resolve, join } = require('node:path')
const autocannon = require('autocannon')
const testCases = require('./testCases')

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const fp = require('fastify-plugin')
const { createHash } = require('crypto')
const { createHash } = require('node:crypto')
const fnv1a = require('./fnv1a')

function validateAlgorithm (algorithm) {
Expand Down
2 changes: 1 addition & 1 deletion test/basic.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const { test } = require('tap')
const { createHash } = require('crypto')
const { createHash } = require('node:crypto')
const generic = require('./generic')
const fnv1a = require('../fnv1a')
const Fastify = require('fastify')
Expand Down
2 changes: 1 addition & 1 deletion test/generic.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const Fastify = require('fastify')
const Etag = require('..')
const { createReadStream } = require('fs')
const { createReadStream } = require('node:fs')

module.exports = function ({ test }, etagOpts, hashFn) {
function build (opts = {}) {
Expand Down

0 comments on commit 9b4835c

Please sign in to comment.