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

N8N-2827 speed up nodes base #3110

Closed
wants to merge 31 commits into from
Closed

Conversation

alexgrozav
Copy link
Contributor

@alexgrozav alexgrozav commented Apr 8, 2022

Issue

Building thousands of files in the nodes-base package is slow. Attempt switching to vite or esbuild.

Findings

Switching to Vite.js

Vite.js is focused on creating application bundles and packages. This means that there should be only a few entry points. The nodes-base package has hundreds of entry points that need to be compiled individually. Even though Vite is super fast, it's not what it is built for.

Vite.js build time

npm run build 59.20s user 2.20s system 178% cpu 18.339 total

Switching to esbuild

Even after switching to esbuild, I was only able to shave off a few seconds from the build because the .d.ts still need to be generated using tsc. Esbuild is fast, but it simply ignores typings when compiling evanw/esbuild#95 (comment).

Proposed solution

Esbuild is able to compile the whole project in under 1s without type definitions. The only typings used outside of development are found in the src folder. Instead of generating typescript definition files for each node, we can generate them only for the files inside the src folder.

This dramatically reduces build time.

Old build time

npm run build:old  22.30s user 1.10s system 176% cpu 13.229 total

New build time

npm run build  3.85s user 0.59s system 125% cpu 3.549 total

Benchmarks run on a 16" MacBook Pro with M1 Pro

If still needed, we could add a script for generating the d.ts for nodes when creating a new release.

Alternatively, could let the build command build all d.ts files and then have a build:fast to rebuild .ts using esbuild, and copy assets only.

What do you think?

@CLAassistant
Copy link

CLAassistant commented Apr 8, 2022

CLA assistant check
All committers have signed the CLA.

@Joffcom Joffcom added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Apr 8, 2022
@alexgrozav alexgrozav force-pushed the N8N-2827-speed-up-nodes-base branch 3 times, most recently from 04a7457 to 73da27d Compare April 11, 2022 08:19
Copy link
Contributor

@ivov ivov left a comment

Choose a reason for hiding this comment

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

Nice work! Cannot wait for 1s build for /nodes-base.

packages/nodes-base/package.json Outdated Show resolved Hide resolved
packages/nodes-base/scripts/build.mjs Outdated Show resolved Hide resolved
packages/nodes-base/scripts/build.mjs Outdated Show resolved Hide resolved
packages/nodes-base/scripts/build.mjs Outdated Show resolved Hide resolved
packages/nodes-base/scripts/watch.mjs Outdated Show resolved Hide resolved
packages/nodes-base/scripts/watch.mjs Outdated Show resolved Hide resolved
packages/nodes-base/tsconfig.build.json Outdated Show resolved Hide resolved
packages/nodes-base/package.json Outdated Show resolved Hide resolved
packages/nodes-base/package.json Outdated Show resolved Hide resolved
Copy link
Contributor

@ivov ivov left a comment

Choose a reason for hiding this comment

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

Sorry for the delay! Re-review:

  1. n8n fails to initialize - unable to load some esbuilt nodes:

git reset --hard; git clean -dffx
lerna bootstrap --hoist; npm run build
npm run start


> n8n@0.168.2 start
> run-script-os

> n8n@0.168.2 start:default
> cd packages/cli/bin && ./n8n

Initializing n8n process
 ›   Error: There was an error: Cannot find module './v1/actions/router'
 ›   Require stack:
 ›   - /Users/ivov/Development/n8n/packages/nodes-base/dist/nodes/BambooHr/BambooHr.node.js
 ›   - /Users/ivov/Development/n8n/packages/cli/dist/src/LoadNodesAndCredentials.js
 ›   - /Users/ivov/Development/n8n/packages/cli/dist/src/index.js
 ›   - /Users/ivov/Development/n8n/packages/cli/dist/commands/execute.js
 ›   - /Users/ivov/Development/n8n/node_modules/@oclif/config/lib/plugin.js
 ›   - /Users/ivov/Development/n8n/node_modules/@oclif/config/lib/config.js
 ›   - /Users/ivov/Development/n8n/node_modules/@oclif/config/lib/index.js
 ›   - /Users/ivov/Development/n8n/node_modules/@oclif/command/lib/command.js
 ›   - /Users/ivov/Development/n8n/node_modules/@oclif/command/lib/index.js
 ›   - /Users/ivov/Development/n8n/packages/cli/bin/n8n

Removing Bamboo HR triggers same error for Cisco Webex and then Elasticsearch.

  1. .d.ts are still being included, becoming .d.js in /dist. The glob in build.mjs is not excluding them: console.log(tsFiles.filter(f => f.endsWith('.d.ts')));
  2. The existing TS build process emits CJS with the use strict directive; esbuild is not doing this, but supports a workaround.
  3. Switching to a non-English locale causes the build to fail:
export N8N_DEFAULT_LOCALE=de
cd packages/nodes-base; npm run build
node:events:368
      throw er; // Unhandled 'error' event
      ^

Error: ENOENT: no such file or directory, open '/Users/ivov/Development/n8n/packages/nodes-base/dist/nodes/headers.js'
Emitted 'error' event on Domain instance at:
    at emit (node:internal/process/promises:134:35)
    at processPromiseRejections (node:internal/process/promises:242:25)
    at processTicksAndRejections (node:internal/process/task_queues:97:32) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/ivov/Development/n8n/packages/nodes-base/dist/nodes/headers.js'
}
ERROR: "build:assets" exited with 1.

This issue is absent from master. The build stages are now parallel, so I expect the attempt to write to the headers path finishes first, failing to find the dist dir.

Edit: 4.5. Should we restore type-checking to the build process with --noEmit?

Minor details

  1. '\n[esbuild] Watching for changes...' is shown both for watch and for build, instead of just for watch. You can use the watch.onRebuild arg, refer to the second watch mode example:
require('esbuild').build({
  entryPoints: ['app.js'],
  outfile: 'out.js',
  bundle: true,
  watch: {
    onRebuild(error, result) {
      if (error) console.error('watch build failed:', error)
      else console.log('watch build succeeded:', result)
    },
  },
}).then(result => {
  console.log('watching...')
})
  1. Instead of removing the existing watch script reference in package.json, we should keep it as watch:old just like the old build script. In a few weeks if there are no issues, we can remove both.
  2. After deletion of watch.mjs, shelljs is now only used for rm -rf. We already have rimraf, so shelljs might not be needed.
  3. The only JSON files in /nodes-base/nodes and /nodes-base/credentials are codex files .node.json and potentially translation files. Both kinds are required cross-package from /cli, i.e. they are not directly imported inside /nodes-base, so I expect that nodes/**/*.json and credentials/translations/**/*.json should be removable from tsconfig.json without import issues.
find ./packages/nodes-base -type f -name \*.json ! -name \*.node.json
  1. (Nitpick) Naming of tsconfig.build.json - the child only takes care of building /src, but both parent and child are responsible for the entire build, which makes the .build. infix for /src potentially confusing. This will become moot once we move src into /cli and skip declaration generation altogether.
  2. (Out of scope, tech debt.) We should eventually explore the esbuild minify and tree-shaking flags.

🚧 Updated dependencies and cleaned up.

⚡ Building nodes-base via esbuild.

🐛 Added copying json files to gulp task.

♻️ Fixed EditImage esModuleInterop warning and PostMark empty body check warning.

✨ Updated npm-run-all to run in parallel

♻️ Refactored pg namespace import.

♻️ Switched to esbuild watch from chokidar.

♻️ Removed unnecessary params from tsconfig.build.json.
@alexgrozav alexgrozav force-pushed the N8N-2827-speed-up-nodes-base branch from b9025f2 to f37a6bc Compare May 18, 2022 11:21
@alexgrozav
Copy link
Contributor Author

Sorry for the delay! Re-review:

  1. n8n fails to initialize - unable to load some esbuilt nodes:

git reset --hard; git clean -dffx
lerna bootstrap --hoist; npm run build
npm run start


> n8n@0.168.2 start
> run-script-os

> n8n@0.168.2 start:default
> cd packages/cli/bin && ./n8n

Initializing n8n process
 ›   Error: There was an error: Cannot find module './v1/actions/router'
 ›   Require stack:
 ›   - /Users/ivov/Development/n8n/packages/nodes-base/dist/nodes/BambooHr/BambooHr.node.js
 ›   - /Users/ivov/Development/n8n/packages/cli/dist/src/LoadNodesAndCredentials.js
 ›   - /Users/ivov/Development/n8n/packages/cli/dist/src/index.js
 ›   - /Users/ivov/Development/n8n/packages/cli/dist/commands/execute.js
 ›   - /Users/ivov/Development/n8n/node_modules/@oclif/config/lib/plugin.js
 ›   - /Users/ivov/Development/n8n/node_modules/@oclif/config/lib/config.js
 ›   - /Users/ivov/Development/n8n/node_modules/@oclif/config/lib/index.js
 ›   - /Users/ivov/Development/n8n/node_modules/@oclif/command/lib/command.js
 ›   - /Users/ivov/Development/n8n/node_modules/@oclif/command/lib/index.js
 ›   - /Users/ivov/Development/n8n/packages/cli/bin/n8n

Removing Bamboo HR triggers same error for Cisco Webex and then Elasticsearch.

The issue seems to have been tiny-glob not going deeply enough into the directory tree. Switched to fast-glob to match cli.

  1. .d.ts are still being included, becoming .d.js in /dist. The glob in build.mjs is not excluding them: console.log(tsFiles.filter(f => f.endsWith('.d.ts')));

Fixed. Fast glob supports negation glob.

  1. The existing TS build process emits CJS with the use strict directive; esbuild is not doing this, but supports a workaround.

Added 'use strict'; via banner.js.

  1. Switching to a non-English locale causes the build to fail:
export N8N_DEFAULT_LOCALE=de
cd packages/nodes-base; npm run build
node:events:368
      throw er; // Unhandled 'error' event
      ^

Error: ENOENT: no such file or directory, open '/Users/ivov/Development/n8n/packages/nodes-base/dist/nodes/headers.js'
Emitted 'error' event on Domain instance at:
    at emit (node:internal/process/promises:134:35)
    at processPromiseRejections (node:internal/process/promises:242:25)
    at processTicksAndRejections (node:internal/process/task_queues:97:32) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/ivov/Development/n8n/packages/nodes-base/dist/nodes/headers.js'
}
ERROR: "build:assets" exited with 1.

This issue is absent from master. The build stages are now parallel, so I expect the attempt to write to the headers path finishes first, failing to find the dist dir.

Edit: 4.5. Should we restore type-checking to the build process with --noEmit?

Fixed. Ensured folder creation upon build. Extracted cleanup phase to start before parallel execution (duh! 😰).

Minor details

  1. '\n[esbuild] Watching for changes...' is shown both for watch and for build, instead of just for watch. You can use the watch.onRebuild arg, refer to the second watch mode example:
require('esbuild').build({
  entryPoints: ['app.js'],
  outfile: 'out.js',
  bundle: true,
  watch: {
    onRebuild(error, result) {
      if (error) console.error('watch build failed:', error)
      else console.log('watch build succeeded:', result)
    },
  },
}).then(result => {
  console.log('watching...')
})

Added proper build message for build mode and watch mode.

  1. Instead of removing the existing watch script reference in package.json, we should keep it as watch:old just like the old build script. In a few weeks if there are no issues, we can remove both.
  1. After deletion of watch.mjs, shelljs is now only used for rm -rf. We already have rimraf, so shelljs might not be needed.

Removed shelljs.

  1. The only JSON files in /nodes-base/nodes and /nodes-base/credentials are codex files .node.json and potentially translation files. Both kinds are required cross-package from /cli, i.e. they are not directly imported inside /nodes-base, so I expect that nodes/**/*.json and credentials/translations/**/*.json should be removable from tsconfig.json without import issues.
find ./packages/nodes-base -type f -name \*.json ! -name \*.node.json

Removed irrelevant files from tsconfig.json.

  1. (Nitpick) Naming of tsconfig.build.json - the child only takes care of building /src, but both parent and child are responsible for the entire build, which makes the .build. infix for /src potentially confusing. This will become moot once we move src into /cli and skip declaration generation altogether.

Renamed it to tsconfig.dts.json. Does this make more sense? How would you name it?

  1. (Out of scope, tech debt.) We should eventually explore the esbuild minify and tree-shaking flags.

Definitely! I'll create a task for it after this one gets merged.

@ivov
Copy link
Contributor

ivov commented May 23, 2022

Thanks for addressing my comments 👍

  1. .d.ts are still being included, becoming .d.js in /dist. Example: packages/nodes-base/nodes/ActionNetwork/types.d.js A sourcemap is also being generated for the transpiled type def file: types.d.js.map
  2. The esbuild dist size is 32.2 MB, the tsc dist was 23.9 MB. Helpers like __toCommonJS are repeated in every file in every node. Is this size increase accounted for and tolerable? More info: QUESTION: best way use esbuild to bundle TypeScript? evanw/esbuild#1984
  3. Typechecking is no longer part of the build process. Is this intentional?
  4. Re: naming for tsconfig.dts.json, I was thinking of tsconfig.src.json, since /src is the only dir that it targets.

@alexgrozav alexgrozav requested a review from ivov June 3, 2022 11:19
@alexgrozav
Copy link
Contributor Author

Thanks for addressing my comments 👍

  1. .d.ts are still being included, becoming .d.js in /dist. Example: packages/nodes-base/nodes/ActionNetwork/types.d.js A sourcemap is also being generated for the transpiled type def file: types.d.js.map

Looks like the fast-glob block pattern is not working properly. Filtered using JS.

  1. The esbuild dist size is 32.2 MB, the tsc dist was 23.9 MB. Helpers like __toCommonJS are repeated in every file in every node. Is this size increase accounted for and tolerable? More info: QUESTION: best way use esbuild to bundle TypeScript? evanw/esbuild#1984

Not much I can do about this, unfortunately.

  1. Typechecking is no longer part of the build process. Is this intentional?
  • Added typechecking back when running npm run build.
  1. Re: naming for tsconfig.dts.json, I was thinking of tsconfig.src.json, since /src is the only dir that it targets.

  • Added npm run build:fast which skips type checking and dramatically reduces build time
  • I found a way to speed tsc up.
    • Apparently, if you don't refer a project when running it from the command line, you're skipping a lot of boilerplate code. This resulted in a 2s increase.
    • More than that, if you add --skipLibCheck, you shave off another 3s from the build time at the cost of ignoring d.ts file dependencies with errors.

npm run build  16.37s user 1.51s system 235% cpu 7.577 total
npm run build:fast  1.35s user 0.82s system 139% cpu 1.561 total
npm run build:old  21.49s user 0.99s system 180% cpu 11.919 total

Copy link
Contributor

@ivov ivov left a comment

Choose a reason for hiding this comment

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

Thank you for the changes. Some final comments:

  1. It is unusual that we only need to build /nodes-base in isolation. /nodes-base is almost always built together with all other packages via dev in the root package.json, i.e. lerna exec npm run dev --parallel, which will run npm run build in /nodes-base. This means that npm run build:fast is unlikely to be used in day-to-day work. Should we add a root command for fast builds?

  2. skipLibCheck will also skip checking of declaration files in the project itself, which is relevant because many nodes contain custom .d.ts files. The best of both worlds would be enabling this flag for the speed boost, but also converting all .d.ts files to .ts to ensure they're type-checked. Context: 1 2 3 4 Maybe we should consider delaying this flag until we can take the time to convert them.

  3. build.mjs is throwing off ESLint:

Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: packages/nodes-base/scripts/build.mjs.
The extension for the file (.mjs) is non-standard. You should add "parserOptions.extraFileExtensions" to your config.

From a quick check, mjs needs to be added to extraFileExtensions or converted to mts which is supported by default, or else we could disregard mjs in .eslintignore.

  1. build:typecheck is now inlining multiple flags to avoid using --project. These flags are a mix of settings already present in tsconfig.json e.g. module and of settings absent from tsconfig.json, e.g. downlevelIteration and allowSyntheticDefaultImports. I am reluctant to introduce duplication and add new compiler flags that were not needed before and that required changes to the source as in Magento and Action Network, for a 2s gain. Commenting mostly to bring up the concern, but up to you.

  2. Why switch module and target to ESNext? From the TS docs: The special ESNext value refers to the highest version your version of TypeScript supports. This setting should be used with caution, since it doesn’t mean the same thing between different TypeScript versions and can make upgrades less predictable.

  3. fast-glob is listed twice in nodes-base/package.json, as regular dependency and as dev dependency.

  4. "test/**/*" is being included and "**/*.spec.ts" is being excluded but all tests in /nodes-base are JS.

@alexgrozav
Copy link
Contributor Author

Update:

  • Added Turborepo integration with parallel build commands
  • Speed up is now 3x for overall build command (85s to 27s)
  • Build caching support via Turborepo
  • Parallelized (uncached) dev support via Turborepo
  • Moved NodeVersionedType to workflow
  • Removed build:fast script
  • Removed tsconfig.dts.json
  • Overhead is now nodes-base and editor-ui, with longest running build command, but parallelization helps a lot

package.json Show resolved Hide resolved
packages/nodes-base/package.json Outdated Show resolved Hide resolved
Copy link
Contributor

@ivov ivov left a comment

Choose a reason for hiding this comment

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

Nice idea to bring in Turborepo :)

  1. Can you please run these? Before making any changes from the review.
git reset --hard; git clean -dffx
lerna bootstrap --hoist
time npm run build
// make a change in a file
time npm run build
system_profiler SPHardwareDataType

I get 2m 10s (first build) and 33s (cached build) on:

Model Name: MacBook Pro
Model Identifier: MacBookPro17,1
Chip: Apple M1
Total Number of Cores: 8 (4 performance and 4 efficiency)
Memory: 16 GB

Comparing against my baseline benchmarks without esbuild and without turbo, only the cached build shows gains, but the first build is identical - this is surprising, as switching to esbuild in nodes-base should give us some gain.

  1. We are removing "nodes/**/*.json" from packages/nodes-base/tsconfig.json, so with this new setup we no longer have codex files in dist. Therefore we should confirm that no external services rely on codex files in dist. For example, Supported Actions and Basic Operations are likely reading from codex files. Bringing this up mostly as I do not know offhand whether they would be affected - if they are reading from "untranspiled" codex files, then no issue.

package.json Outdated Show resolved Hide resolved
packages/nodes-base/tsconfig.json Outdated Show resolved Hide resolved
"build": "rimraf dist && npm-run-all --parallel build:esbuild build:gulp build:tsc",
"build:esbuild": "node scripts/build.mjs",
"build:gulp": "gulp build:assets build:translations",
"build:tsc": "tsc --project tsconfig.json --emitDeclarationOnly",
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. Do we need to specify the path to tsconfig with --project?
  2. --emitDeclarationOnly is no longer be needed I think? Also should this not be --noEmit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. No need to specify project.
  2. Added d.ts emitting since it doesn't impact build speed.

packages/nodes-base/gulpfile.js Show resolved Hide resolved
Comment on lines 20 to 21
const tsFiles = (await glob([path.resolve(rootDir, '{credentials,nodes,src}/**/*.ts')]))
.filter((file) => !file.endsWith('.d.ts'));
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. src no longer exists.
  2. This runs very frequently and over a large number of files, so let's optimize. One idea is to recurse and check during traversal. What do you think?
function walk(dir, test, collection = []) {
	fs.readdirSync(dir).forEach((entry) => {
		const entryPath = path.resolve(dir, entry);

		if (fs.lstatSync(entryPath).isDirectory()) {
			walk(entryPath, test, collection);
		}

		if (test(entry)) collection.push(entryPath);
	});

	return collection;
}

const isTsFile = (filepath) => /(?<!\.d)\.ts$/.test(filepath);

const tsFiles = ['nodes', 'credentials'].flatMap((dir) => walk(dir, isTsFile));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. Removed src
  2. That's essentially what the glob does as well, and it runs only once. The overhead is tsc, unfortunately. The build.mjs script runs in a few hundred milliseconds.

Copy link
Contributor

Choose a reason for hiding this comment

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

  1. But after glob there is filter so double iteration? walk is intended to avoid double iteration as it includes filter as test. Let me know if I'm misunderstanding.

Comment on lines +10 to +14
import type { Workflow } from './Workflow';
import type { WorkflowHooks } from './WorkflowHooks';
import type { WorkflowActivationError } from './WorkflowActivationError';
import type { WorkflowOperationError } from './WorkflowErrors';
import type { NodeApiError, NodeOperationError } from './NodeErrors';
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you are touching these, let's also cover L6 to L9.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to import type.

@@ -1,25 +1,29 @@
import { INodeType, INodeTypeBaseDescription, INodeVersionedType } from 'n8n-workflow';
import { INodeType, INodeTypeBaseDescription, INodeVersionedType } from './Interfaces';
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
import { INodeType, INodeTypeBaseDescription, INodeVersionedType } from './Interfaces';
import type { INodeType, INodeTypeBaseDescription, INodeVersionedType } from './Interfaces';

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

description: INodeTypeBaseDescription;

constructor(nodeVersions: INodeVersionedType['nodeVersions'], description: INodeTypeBaseDescription) {
constructor(
Copy link
Contributor

Choose a reason for hiding this comment

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

One concern with relocating this class purely for build performance reasons is that we are not keeping related functionality together, since NodeVersionedType fits better in nodes-base than in workflow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've had the same concern. But after giving it some thought, the NodeVersionedType.ts file doesn't look like something that's likely to change too often, and it directly implements an interface declared in workflow, so the location felt right.

In my opinion the build speed benefit will be worth it in the long run. What do you think?

@@ -0,0 +1,41 @@
{
"$schema": "https://turborepo.org/schema.json",
Copy link
Contributor

@ivov ivov Jun 27, 2022

Choose a reason for hiding this comment

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

General question: If ^build makes any package's build depend on its dependencies' build having completed first, as explained here, then why do we need to specify our chain of dependencies by hand with the keys below? And why does the specified list of dependencies in turbo.json not reflect the dependency lists in package.json in our various packages?

  • design-system does not depend on any package, but turbo.json lists core as a dependency.
  • editor-ui depends on design-system and workflow, but turbo.json lists core as a dependency.
  • cli depends on workflow, core and editor-ui, but turbo.json again lists core.

(Never used Turborepo before, there is probably a reason, mostly curious.)

Smaller comments:

  1. Turborepo always needs outputs to be specified and is unable to find this in tsconfig.json?
  2. format, lint and lintfix are not included in turbo.json. test is included, but it is still set to run with lerna in the root package.json.
  3. We do not use tsx.
  4. full is the default output mode and so does not need to be specified.
  5. Re: inputs, not all code relevant to tests is in /src and /test, e.g./cli/commands, /cli/config, /nodes-base/nodes, etc.
  6. "n8n-editor-ui#build" When using vue-cli-service build, I notice it reports Using 1 worker with 2048MB memory limit. Since editor-ui is one of the slowest building packages, can we experiment with adding workers and raising the memory limit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like there's no real benefit in defining build dependencies explicitly. When left to use the dependency graph, turborepo does a great job by itself.

  1. You're right. It's able to infer the build outputs.
  2. I have not looked into test format, lint and lintfix yet. Will do now.
  3. Good point. Removed.
  4. Removed outputMode.
  5. Removed inputs
  6. Increased memory limit, but doesn't impact build speed unfortunately. Webpack / Vue CLI is still a bottleneck until we migrate to Vite.js.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Converted remaining lerna run scripts.

@alexgrozav alexgrozav force-pushed the N8N-2827-speed-up-nodes-base branch from 788ef78 to 92e2f8e Compare July 1, 2022 13:51
@csuermann csuermann removed their request for review September 16, 2022 13:29
@alexgrozav alexgrozav closed this Feb 14, 2023
@alexgrozav alexgrozav deleted the N8N-2827-speed-up-nodes-base branch February 14, 2023 08:26
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

5 participants