Skip to content
Preptima
hardConceptMidSeniorStaff

A method has been running fast for an hour and then gets slower, with no code change and no extra traffic. What might the runtime be doing?

5 min readUpdated 2026-08-15Target archetype: Big Tech, Enterprise Captive, Product Startup

Answer

Short answer

A JIT compiles against a profile gathered earlier, so its fast code rests on assumptions that can be invalidated: a new receiver type at a call site, a branch taken for the first time, a class loaded that gives an interface a second implementation.

Was this answer helpful?

Likely follow-ups

  • How would you keep a shared utility method's call sites monomorphic, and what does that cost you in design terms?
  • What must a warm-up phase exercise for the steady-state profile to resemble production?
  • What happens to compiled code when an instrumenting agent is attached to a running process?
  • Why can a microbenchmark that exercises one implementation mislead you about code that sees three?

Related questions

Related Topics