From 0ded880c93d3d179e720c57992b876e5167456c6 Mon Sep 17 00:00:00 2001 From: uzlopak Date: Tue, 27 Feb 2024 18:36:48 +0100 Subject: [PATCH] chore: restructure benchmarks --- .../{cacheGetFieldValues.mjs => cache/get-field-values.mjs} | 2 +- .../Is-ctl-excluding-htab.mjs} | 2 +- benchmarks/{parseHeaders.mjs => core/parse-headers.mjs} | 2 +- benchmarks/{parseRawHeaders.mjs => core/parse-raw-headers.mjs} | 2 +- benchmarks/{TernarySearchTree.mjs => core/tree.mjs} | 2 +- benchmarks/{ => fetch}/headers-length32.mjs | 2 +- benchmarks/{ => fetch}/headers.mjs | 2 +- .../is-valid-subprotocol.mjs} | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) rename benchmarks/{cacheGetFieldValues.mjs => cache/get-field-values.mjs} (85%) rename benchmarks/{cookiesIsCTLExcludingHtab.mjs => cookies/Is-ctl-excluding-htab.mjs} (84%) rename benchmarks/{parseHeaders.mjs => core/parse-headers.mjs} (98%) rename benchmarks/{parseRawHeaders.mjs => core/parse-raw-headers.mjs} (93%) rename benchmarks/{TernarySearchTree.mjs => core/tree.mjs} (91%) rename benchmarks/{ => fetch}/headers-length32.mjs (95%) rename benchmarks/{ => fetch}/headers.mjs (96%) rename benchmarks/{websocketIsValidSubprotocol.mjs => websocket/is-valid-subprotocol.mjs} (81%) diff --git a/benchmarks/cacheGetFieldValues.mjs b/benchmarks/cache/get-field-values.mjs similarity index 85% rename from benchmarks/cacheGetFieldValues.mjs rename to benchmarks/cache/get-field-values.mjs index 9a685d24544..c62f7737251 100644 --- a/benchmarks/cacheGetFieldValues.mjs +++ b/benchmarks/cache/get-field-values.mjs @@ -1,5 +1,5 @@ import { bench, group, run } from 'mitata' -import { getFieldValues } from '../lib/web/cache/util.js' +import { getFieldValues } from '../../lib/web/cache/util.js' const values = [ '', diff --git a/benchmarks/cookiesIsCTLExcludingHtab.mjs b/benchmarks/cookies/Is-ctl-excluding-htab.mjs similarity index 84% rename from benchmarks/cookiesIsCTLExcludingHtab.mjs rename to benchmarks/cookies/Is-ctl-excluding-htab.mjs index b0e134b22d2..12cdb901c21 100644 --- a/benchmarks/cookiesIsCTLExcludingHtab.mjs +++ b/benchmarks/cookies/Is-ctl-excluding-htab.mjs @@ -1,5 +1,5 @@ import { bench, group, run } from 'mitata' -import { isCTLExcludingHtab } from '../lib/web/cookies/util.js' +import { isCTLExcludingHtab } from '../../lib/web/cookies/util.js' const valid = 'Space=Cat; Secure; HttpOnly; Max-Age=2' const invalid = 'Space=Cat; Secure; HttpOnly; Max-Age=2\x7F' diff --git a/benchmarks/parseHeaders.mjs b/benchmarks/core/parse-headers.mjs similarity index 98% rename from benchmarks/parseHeaders.mjs rename to benchmarks/core/parse-headers.mjs index 6fb898062b3..439986da93d 100644 --- a/benchmarks/parseHeaders.mjs +++ b/benchmarks/core/parse-headers.mjs @@ -1,5 +1,5 @@ import { bench, group, run } from 'mitata' -import { parseHeaders } from '../lib/core/util.js' +import { parseHeaders } from '../../lib/core/util.js' const target = [ { diff --git a/benchmarks/parseRawHeaders.mjs b/benchmarks/core/parse-raw-headers.mjs similarity index 93% rename from benchmarks/parseRawHeaders.mjs rename to benchmarks/core/parse-raw-headers.mjs index b7ac0f92586..8f789dfc10c 100644 --- a/benchmarks/parseRawHeaders.mjs +++ b/benchmarks/core/parse-raw-headers.mjs @@ -1,5 +1,5 @@ import { bench, group, run } from 'mitata' -import { parseRawHeaders } from '../lib/core/util.js' +import { parseRawHeaders } from '../../lib/core/util.js' const rawHeadersMixed = ['key', 'value', Buffer.from('key'), Buffer.from('value')] const rawHeadersOnlyStrings = ['key', 'value', 'key', 'value'] diff --git a/benchmarks/TernarySearchTree.mjs b/benchmarks/core/tree.mjs similarity index 91% rename from benchmarks/TernarySearchTree.mjs rename to benchmarks/core/tree.mjs index 413288a6af3..1e268e477ea 100644 --- a/benchmarks/TernarySearchTree.mjs +++ b/benchmarks/core/tree.mjs @@ -1,5 +1,5 @@ import { bench, group, run } from 'mitata' -import { tree } from '../lib/core/tree.js' +import { tree } from '../../lib/core/tree.js' const contentLength = Buffer.from('Content-Length') const contentLengthUpperCase = Buffer.from('Content-Length'.toUpperCase()) diff --git a/benchmarks/headers-length32.mjs b/benchmarks/fetch/headers-length32.mjs similarity index 95% rename from benchmarks/headers-length32.mjs rename to benchmarks/fetch/headers-length32.mjs index 9f1c0a906f8..744263f2569 100644 --- a/benchmarks/headers-length32.mjs +++ b/benchmarks/fetch/headers-length32.mjs @@ -1,5 +1,5 @@ import { bench, run } from 'mitata' -import { Headers } from '../lib/web/fetch/headers.js' +import { Headers } from '../../lib/web/fetch/headers.js' const headers = new Headers( [ diff --git a/benchmarks/headers.mjs b/benchmarks/fetch/headers.mjs similarity index 96% rename from benchmarks/headers.mjs rename to benchmarks/fetch/headers.mjs index 8722cf11c1f..d529370c40c 100644 --- a/benchmarks/headers.mjs +++ b/benchmarks/fetch/headers.mjs @@ -1,5 +1,5 @@ import { bench, group, run } from 'mitata' -import { Headers } from '../lib/web/fetch/headers.js' +import { Headers } from '../../lib/web/fetch/headers.js' const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' const charactersLength = characters.length diff --git a/benchmarks/websocketIsValidSubprotocol.mjs b/benchmarks/websocket/is-valid-subprotocol.mjs similarity index 81% rename from benchmarks/websocketIsValidSubprotocol.mjs rename to benchmarks/websocket/is-valid-subprotocol.mjs index d4ab287ba41..8929f1fa8ea 100644 --- a/benchmarks/websocketIsValidSubprotocol.mjs +++ b/benchmarks/websocket/is-valid-subprotocol.mjs @@ -1,5 +1,5 @@ import { bench, group, run } from 'mitata' -import { isValidSubprotocol } from '../lib/web/websocket/util.js' +import { isValidSubprotocol } from '../../lib/web/websocket/util.js' const valid = 'valid' const invalid = 'invalid '