Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(core): Introduce backend performance benchmarking #9199

Closed
wants to merge 91 commits into from

Conversation

ivov
Copy link
Contributor

@ivov ivov commented Apr 23, 2024

This PR introduces tinybench and Codspeed to benchmark changes to backend performance (execution time) and report improvements or regressions via CI.

Context: https://www.notion.so/n8n/Performance-benchmarking-6b66f7bf672b467a9763f81df789b08d

@@ -167,7 +167,7 @@ export abstract class AbstractServer {

await this.setupHealthCheck();

console.log(`n8n ready on ${ADDRESS}, port ${PORT}`);
this.logger.info(`n8n ready on ${ADDRESS}, port ${PORT}`);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Logging changes like these ensure N8N_LOG_LEVEL=silent mutes this logging noise during benchmarking runs.

Comment on lines +10 to +15
+ let uri = `${callingFile}::${name}`;
+ if (name.includes('::')) {
+ // ignore calling file misdirecting to benchmark/lib/api.js
+ const [suiteName, taskName] = name.split('::');
+ uri = `${suiteName} - ${taskName}`
+ }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ivov ivov marked this pull request as ready for review May 2, 2024 08:16
Copy link

codspeed-hq bot commented May 2, 2024

CodSpeed Performance Report

Congrats! CodSpeed is installed 🎉

🆕 3 new benchmarks were detected.

You will start to see performance impacts in the reports once the benchmarks are run from your default branch.

Detected benchmarks

  • Production workflow with authless webhook node - using "Respond immediately" mode (118 ms)
  • Production workflow with authless webhook node - using "Respond to Webhook node" mode (92.4 ms)
  • Production workflow with authless webhook node - using "When last node finishes" mode (126.8 ms)

@ivov
Copy link
Contributor Author

ivov commented May 3, 2024

To check after this is in master:

  • Do we get two reports for the two DBs?
  • Does untouched benchmarks detection work properly?

@ivov
Copy link
Contributor Author

ivov commented May 13, 2024

Closing due to excessive variance

@ivov ivov closed this May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants