Skip to content

Commit

Permalink
refactor: remove fdir from benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmlnc committed Dec 1, 2024
1 parent 6e15541 commit 5f42092
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 48 deletions.
4 changes: 2 additions & 2 deletions herebyfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ export const {
productStreamTask,
productSyncTask,
} = {
productAsyncTask: makeBenchSuiteTask('product', 'async', PRODUCT_ASYNC_SUITE, ['fast-glob', 'node-glob', 'fdir', 'tinyglobby']),
productAsyncTask: makeBenchSuiteTask('product', 'async', PRODUCT_ASYNC_SUITE, ['fast-glob', 'node-glob', 'tinyglobby']),
productStreamTask: makeBenchSuiteTask('product', 'stream', PRODUCT_STREAM_SUITE, ['fast-glob', 'node-glob']),
productSyncTask: makeBenchSuiteTask('product', 'sync', PRODUCT_SYNC_SUITE, ['fast-glob', 'node-glob', 'fdir', 'tinyglobby']),
productSyncTask: makeBenchSuiteTask('product', 'sync', PRODUCT_SYNC_SUITE, ['fast-glob', 'node-glob', 'tinyglobby']),
};

export const {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"eslint-config-mrmlnc": "^5.0.0",
"execa": "^7.2.0",
"fast-glob": "^3.3.2",
"fdir": "^6.4.2",
"glob": "^11.0.0",
"hereby": "^1.10.0",
"mocha": "^10.8.2",
Expand Down
20 changes: 1 addition & 19 deletions src/benchmark/suites/product/async.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as bencho from 'bencho';

import * as utils from '../../utils';

type GlobImplementation = 'fast-glob' | 'fdir' | 'node-glob' | 'tinyglobby';
type GlobImplementation = 'fast-glob' | 'node-glob' | 'tinyglobby';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type GlobImplFunction = (...args: any[]) => Promise<unknown[]>;

Expand Down Expand Up @@ -36,19 +36,6 @@ class Glob {
}));
}

public async measureFdir(): Promise<void> {
const { fdir: FdirBuilder } = await utils.importAndMeasure(utils.importFdir);

const fdir = new FdirBuilder()
.withBasePath()
.withRelativePaths()
// Other solutions do not include hidden files by default
.globWithOptions([this.#pattern], { dot: false })
.crawl(this.#cwd);

await this.#measure(() => fdir.withPromise());
}

public async measureTinyGlobby(): Promise<void> {
const tinyglobby = await utils.importAndMeasure(utils.importTinyGlobby);

Expand Down Expand Up @@ -94,11 +81,6 @@ class Glob {
break;
}

case 'fdir': {
await glob.measureFdir();
break;
}

case 'tinyglobby': {
await glob.measureTinyGlobby();
break;
Expand Down
20 changes: 1 addition & 19 deletions src/benchmark/suites/product/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as bencho from 'bencho';

import * as utils from '../../utils';

type GlobImplementation = 'fast-glob' | 'fdir' | 'node-glob' | 'tinyglobby';
type GlobImplementation = 'fast-glob' | 'node-glob' | 'tinyglobby';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type GlobImplFunction = (...args: any[]) => unknown[];

Expand Down Expand Up @@ -36,19 +36,6 @@ class Glob {
}));
}

public async measureFdir(): Promise<void> {
const { fdir: FdirBuilder } = await utils.importAndMeasure(utils.importFdir);

const fdir = new FdirBuilder()
.withBasePath()
.withRelativePaths()
// Other solutions do not include hidden files by default
.globWithOptions([this.#pattern], { dot: false })
.crawl(this.#cwd);

this.#measure(() => fdir.sync());
}

public async measureTinyGlobby(): Promise<void> {
const tinyglobby = await utils.importAndMeasure(utils.importTinyGlobby);

Expand Down Expand Up @@ -94,11 +81,6 @@ class Glob {
break;
}

case 'fdir': {
await glob.measureFdir();
break;
}

case 'tinyglobby': {
await glob.measureTinyGlobby();
break;
Expand Down
5 changes: 0 additions & 5 deletions src/benchmark/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import * as bencho from 'bencho';
import type * as currentVersion from '..';
import type * as previousVersion from 'fast-glob';
import type * as glob from 'glob';
import type * as fdir from 'fdir';
import type * as tg from 'tinyglobby';

export function timeStart(): number {
Expand All @@ -32,10 +31,6 @@ export function importNodeGlob(): Promise<typeof glob> {
return import('glob');
}

export function importFdir(): Promise<typeof fdir> {
return import('fdir');
}

export function importTinyGlobby(): Promise<typeof tg> {
return import('tinyglobby');
}
Expand Down
2 changes: 1 addition & 1 deletion src/tests/e2e/runner.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable mocha/no-setup-in-describe */
import * as assert from 'node:assert';

import snapshotIt from 'snap-shot-it';
import * as snapshotIt from 'snap-shot-it';
import { describe, it } from 'mocha';

import * as fg from '../..';
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

"forceConsistentCasingInFileNames": true,
"verbatimModuleSyntax": false,
"esModuleInterop": true,

"downlevelIteration": true,
"declaration": true,
Expand Down

0 comments on commit 5f42092

Please sign in to comment.