codeflash/packages
Sarthak Agarwal 66fadf7ad3 fix: use getter functions for perf env vars to support Vitest module caching
Vitest caches modules and may load capture.js before environment
variables like CODEFLASH_PERF_LOOP_COUNT are set. When these were
read as constants at module load time, they would always return
default values.

This change converts the performance configuration from constants
to getter functions that read environment variables at runtime,
ensuring correct values are used even when the module is cached.

Fixes:
- PERF_LOOP_COUNT always being 1 in Vitest
- PERF_BATCH_SIZE, PERF_MIN_LOOPS, etc. using defaults instead of env values

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:02:23 +05:30
..
codeflash fix: use getter functions for perf env vars to support Vitest module caching 2026-02-03 18:02:23 +05:30