Skip to content

Create benchmark & improve perf - #483

Merged
eddeee888 merged 5 commits into
masterfrom
benchmark
Aug 29, 2026
Merged

Create benchmark & improve perf#483
eddeee888 merged 5 commits into
masterfrom
benchmark

Conversation

@eddeee888

Copy link
Copy Markdown
Owner
  • Create script to generate benchmark
  • avoid parsing schema for in every run with add-only plugin.
    • this is achieved by passing the schemaAst from the CLI into every generates block

@changeset-bot

changeset-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9991444

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@eddeee888/gcg-typescript-resolver-files Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment on lines +32 to +56
/** Minimal profiler matching the `context.profiler` shape used across CLI versions. */
interface RecordingProfiler {
outputName: null;
run<T>(fn: () => T | Promise<T>, name: string): Promise<T>;
collect(): { name: string; dur: number }[];
clear(): void;
}

const createRecordingProfiler = (): RecordingProfiler => {
const events: { name: string; dur: number }[] = [];
return {
outputName: null,
async run(fn, name) {
const start = performance.now();
const value = await fn();
// dur in microseconds, matching graphql-codegen's ProfilerEvent.
events.push({ name, dur: (performance.now() - start) * 1000 });
return value;
},
collect: () => events,
clear: () => {
events.length = 0;
},
};
};

@eddeee888 eddeee888 Aug 27, 2026

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: fix codegen's profiler to allow re-use here (?)

@eddeee888
eddeee888 marked this pull request as ready for review August 27, 2026 11:57
@eddeee888

Copy link
Copy Markdown
Owner Author

/release-snapshot

@github-actions

Copy link
Copy Markdown
Contributor

Snapshot published

@eddeee888/gcg-operation-location-migration@0.0.0-pr467-run390-1-20260809065829
@eddeee888/gcg-server-config@0.0.0-pr467-run390-1-20260809065829
@eddeee888/gcg-typescript-resolver-files@0.0.0-pr480-run415-1-20260825133324

@eddeee888
eddeee888 merged commit a36d487 into master Aug 29, 2026
13 checks passed
@eddeee888
eddeee888 deleted the benchmark branch August 29, 2026 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant