Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
chore: add ff
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Nov 3, 2022
1 parent d66bc4a commit 51f6f58
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/feature_flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ export const defaultFlags: Record<string, boolean> = {

// Load configuration from per-function JSON files.
project_deploy_configuration_api_use_per_function_configuration_files: false,

// Enable runtime cache for NFT
zisi_nft_use_cache: false,

// Raise file IO limit for NFT
zisi_nft_higher_fileio_limit: false,
}

export type FeatureFlag = keyof typeof defaultFlags
Expand Down
4 changes: 2 additions & 2 deletions src/runtimes/node/bundlers/nft/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ const traceFilesAndTranspile = async function ({
reasons,
} = await nodeFileTrace([mainFile], {
// Default is 1024. Allowing double the fileIO in parallel makes nft faster, but uses a little more memory.
fileIOConcurrency: 2048,
fileIOConcurrency: featureFlags.zisi_nft_higher_fileio_limit ? 2048 : 1024,
base: basePath,
cache: cache.nftCache,
cache: featureFlags.zisi_nft_use_cache ? cache.nftCache : undefined,
ignore: ignoreFunction,
readFile: async (path: string) => {
try {
Expand Down

0 comments on commit 51f6f58

Please sign in to comment.