Skip to content

Commit

Permalink
fix: adjust ci & lint to new benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
erikwrede committed Oct 17, 2024
1 parent 64729f8 commit 9c713c9
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 170 deletions.
1 change: 1 addition & 0 deletions .c8rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"exclude": [
"src/**/index.ts",
"src/**/*-fuzz.ts",
"src/**/__benchmarks__/*.ts",
"src/jsutils/Maybe.ts",
"src/jsutils/ObjMap.ts",
"src/jsutils/PromiseOrValue.ts",
Expand Down
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@

# Ignore TS files inside integration test
/integrationTests/ts/*.ts

# Ignore config files
/vitest.config.ts
6 changes: 6 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,12 @@ module.exports = {
],
},
},
{
files: 'src/**/__benchmarks__/**',
rules: {
'import/no-nodejs-modules': 'off',
},
},
{
files: 'integrationTests/*',
env: {
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ jobs:
rm gitignore/Global/Images.gitignore
cat gitignore/Node.gitignore gitignore/Global/*.gitignore > all.gitignore
IGNORED_FILES=$(git ls-files --cached --ignored --exclude-from=all.gitignore)
IGNORED_FILES=$(git ls-files --cached --ignored --exclude-from=all.gitignore)
IGNORED_FILES=$(echo "$IGNORED_FILES" | grep -v 'patches/@codspeed+core+3.1.0.patch')
if [[ "$IGNORED_FILES" != "" ]]; then
echo -e "::error::Please remove these files:\n$IGNORED_FILES" | sed -z 's/\n/%0A/g'
exit 1
Expand Down
162 changes: 0 additions & 162 deletions resources/benchmark-tinybench.ts

This file was deleted.

12 changes: 7 additions & 5 deletions src/__benchmarks__/list.bench.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { bench,describe } from "vitest";
import { bench, describe } from 'vitest';

import { parse } from '../language/parser.js';

Expand All @@ -17,6 +17,7 @@ function syncListField() {
return results;
}

// eslint-disable-next-line @typescript-eslint/require-await
async function asyncListField() {
const results = [];
for (let index = 0; index < 1000; index++) {
Expand All @@ -25,22 +26,23 @@ async function asyncListField() {
return results;
}

// eslint-disable-next-line @typescript-eslint/require-await
async function* asyncIterableListField() {
for (let index = 0; index < 1000; index++) {
yield index;
}
}

describe("execute listField benchmarks", () => {
bench("Execute Synchronous List Field", async () => {
describe('execute listField benchmarks', () => {
bench('Execute Synchronous List Field', async () => {
await execute({ schema, document, rootValue: { listField: syncListField } });
});

bench("Execute Asynchronous List Field", async () => {
bench('Execute Asynchronous List Field', async () => {
await execute({ schema, document, rootValue: { listField: asyncListField } });
});

bench("Execute Async Iterable List Field", async () => {
bench('Execute Async Iterable List Field', async () => {
await execute({ schema, document, rootValue: { listField: asyncIterableListField } });
});
});
3 changes: 1 addition & 2 deletions src/__benchmarks__/visitor.bench.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { bench, describe } from 'vitest';

import { visit, visitInParallel } from '../language/visitor.js';

import { parse } from '../language/parser.js';
import { visit, visitInParallel } from '../language/visitor.js';

import { bigSchemaSDL } from './fixtures.js';

Expand Down

0 comments on commit 9c713c9

Please sign in to comment.