From 8b738a22efbb8ced41e8d0e3f97b0f6cf35ff12a Mon Sep 17 00:00:00 2001 From: Daniel Tschinder <231804+danez@users.noreply.github.com> Date: Thu, 3 Nov 2022 15:17:11 +0100 Subject: [PATCH] chore: add ff --- src/feature_flags.ts | 6 ++++++ src/runtimes/node/bundlers/nft/index.ts | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) 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 {