codeflash 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeflash",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Codeflash - AI-powered code optimization for JavaScript and TypeScript",
5
5
  "main": "runtime/index.js",
6
6
  "types": "runtime/index.d.ts",
@@ -32,7 +32,11 @@ const internalRequire = createRequire(jestRunnerPath);
32
32
  const runTest = internalRequire('./runTest').default;
33
33
 
34
34
  // Configuration
35
- const MAX_BATCHES = parseInt(process.env.CODEFLASH_PERF_LOOP_COUNT || '10000', 10);
35
+ const PERF_LOOP_COUNT = parseInt(process.env.CODEFLASH_PERF_LOOP_COUNT || '10000', 10);
36
+ const PERF_BATCH_SIZE = parseInt(process.env.CODEFLASH_PERF_BATCH_SIZE || '10', 10);
37
+ // MAX_BATCHES = how many batches needed to reach PERF_LOOP_COUNT iterations
38
+ // Add 1 to handle any rounding, but cap at PERF_LOOP_COUNT to avoid excessive batches
39
+ const MAX_BATCHES = Math.min(Math.ceil(PERF_LOOP_COUNT / PERF_BATCH_SIZE) + 1, PERF_LOOP_COUNT);
36
40
  const TARGET_DURATION_MS = parseInt(process.env.CODEFLASH_PERF_TARGET_DURATION_MS || '10000', 10);
37
41
  const MIN_BATCHES = parseInt(process.env.CODEFLASH_PERF_MIN_LOOPS || '5', 10);
38
42