<b>6.0.0.2483</b>
Dmitry Yemanov 2026.11.17 14:26:54
Keep the grouped statistics slow path out of line
GroupedCountsArray::operator[] inlined both the SortedArray lookup and the
insertion branch into every RuntimeStatistics::bumpValue() call. As bumpValue()
runs three times per page fetch, the inlined slow path gave that function a
104-byte frame and a stack-protector check on each call, even though the
m_lastPos fast path almost always hit.
Move the search and insertion into an out-of-line findOrAdd() and keep only the
m_lastPos check inline. The fast path becomes leaf-like, and bumpValue() is then
small enough to be inlined into bumpStats(), which is called once per fetch.
The two template instantiations are emitted explicitly in RuntimeStatistics.cpp,
as the slow path is used from other translation units.
Measured on 500k rows (callgrind, single scan pass): 49M fewer instructions
(2.9%) and ~5% lower wall time, with the page statistics path dropping from
134 to 69 instructions per fetch.

Changed paths:
  M src/jrd/RuntimeStatistics.cpp
  M src/jrd/RuntimeStatistics.h