Only count VM instructions in YJIT stats builds

The instruction counter is slowing multi-Ractor applications.  I had
changed it to use a thread local, but using a thread local is slowing
single threaded applications.  This commit only enables the instruction
counter in YJIT stats builds until we can figure out a way to gather the
information with lower overhead.

Co-authored-by: Randy Stauner <randy.stauner@shopify.com>
This commit is contained in:
Aaron Patterson 2025-02-13 09:56:21 -08:00 committed by Aaron Patterson
parent c1ce3d719d
commit 8cafa5b8ce
Notes: git 2025-02-14 19:39:53 +00:00
9 changed files with 21 additions and 21 deletions

View file

@ -13,7 +13,7 @@
#if USE_YJIT
// The number of instructions executed on vm_exec_core. --yjit-stats uses this.
RB_THREAD_LOCAL_SPECIFIER uint64_t rb_vm_insns_count = 0;
uint64_t rb_vm_insns_count = 0;
#endif
#if VM_COLLECT_USAGE_DETAILS