diff --git a/src/feature_flags.ts b/src/feature_flags.ts index 7a175f2d5..79946583c 100644 --- a/src/feature_flags.ts +++ b/src/feature_flags.ts @@ -20,6 +20,12 @@ export const defaultFlags: Record = { // Load configuration from per-function JSON files. project_deploy_configuration_api_use_per_function_configuration_files: false, + + // Enable runtime cache for NFT + zisi_nft_cache_changes: false, + + // Raise file IO limit for NFT + zisi_nft_higher_fileio_limit: false, } export type FeatureFlag = keyof typeof defaultFlags diff --git a/src/runtimes/node/bundlers/nft/index.ts b/src/runtimes/node/bundlers/nft/index.ts index d8b91f1fa..2d9fa3ea9 100644 --- a/src/runtimes/node/bundlers/nft/index.ts +++ b/src/runtimes/node/bundlers/nft/index.ts @@ -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_cache_changes ? cache.nftCache : undefined, ignore: ignoreFunction, readFile: async (path: string) => { try {