A performance bottleneck is a constraint that limits progress or throughput. A system should not be called memory bound without evidence that memory is the limiting resource. The measurements here investigate file I/O and scanning; they do not establish a memory bottleneck. section 7.3.1
Static analysis can suggest a hot path, but it does not establish its runtime impact. Instrument a separate version of the application, run traffic representative of production, and compare method timings with counts of file reads and lines scanned before choosing an optimization. section 7.3.1
Word lookup under simulated traffic
A Gatling simulation produced 210 file reads and roughly 32.2 million lines scanned. The reported memory-used value was zero, which does not demonstrate that memory was the limiting resource. An AI-generated diagnosis identified file I/O and linear search as potential issues, but its projected improvements still require verification. section 7.3.1
Listing 7.14 The measurements implemented by LLM
{
"averageMethodTimesMs": {
"getMetrics_endpoint": 0.638847,
"getWordOfTheDay": 14.7273958,
"resetMetrics_endpoint": 0.012584,
"wordExists": 27.8176992,
"wordExists_endpoint": 27.85579776,
"getIndexForToday": 0.4263418,
"getWordOfTheDay_endpoint": 14.7813709
},
"methodCallCounts": {
"getMetrics_endpoint": 3,
"getWordOfTheDay": 10,
"resetMetrics_endpoint": 1,
"wordExists": 200,
"wordExists_endpoint": 200,
"getIndexForToday": 10,
"getWordOfTheDay_endpoint": 10
},
"totalFileReads": 210,
"totalBytesRead": 332209460,
"totalFileOpenTimeMs": 28.926387,
"totalStringComparisons": 31897400,
"totalLinesScanned": 32189660,
"totalRequests": 210,
"endpointCallCounts": {
"word-of-the-day": 10,
"word-exists": 200
},
"totalMemoryUsed": 0
}Inspect the method timings, call counts, file activity, and memory metric together. section 7.3.1

















