Cod3xDocs
guide

Performance

Profiling, hot paths, caches, engine boundaries, LuaJIT analysis, and benchmark design.

“OpenMW Lua is slow” is not a diagnosis.

A useful performance investigation asks where the time or memory goes.

The cost may be:

  • Lua execution;
  • allocation;
  • table/string churn;
  • a repeated global/property lookup;
  • an engine query;
  • userdata construction/finalization;
  • serialization;
  • event dispatch;
  • ray casting or physics;
  • a C++ binding;
  • a LuaJIT trace abort or side exit;
  • GC behavior;
  • work that never belonged on every frame in the first place.

Start with Measure First. Use Pr0f1l3r for in-engine telemetry. Events, Serialization, and Boundary Traffic covers message-heavy systems. Move into Bytecode, Traces, and Engine Boundaries only when the evidence points there.

Do not start with the cleverest optimization you know.