← All Posts

EchoQuest v0.19.6: Performance Profiling & Optimization Prep

This update has no gameplay changes — and that’s the point. Before we can make EchoQuest faster, we need to know exactly where time is being spent. This release instruments the server and client with profiling tools, tunes configuration baselines, and lays the foundation for the optimization work ahead.

WebSocket Compression

Socket.io now uses permessage-deflate compression for messages larger than 1KB. Small, frequent messages like position updates (~50 bytes) pass through untouched, but larger payloads — combat enemy lists, map data, inventory syncs — get compressed on the wire. This is a free bandwidth win with no gameplay impact.

Asset Caching

Static assets (sprites, tilesets, audio) were cached for 1 day. Since these rarely change between sessions, we bumped this to 7 days. Returning players will load the game faster because their browser already has the assets cached. The nginx config also adds explicit Cache-Control headers for image and audio files.

Database Hardening

Three changes to the database layer:

AI Tick Profiling

The enemy AI runs at 10 ticks per second, processing aggro, pathfinding, traps, minions, and position broadcasts for every active map. We now measure each subsystem independently — if aggro checks take 30ms on a busy map, we’ll see it in the metrics. Active map count and total enemy count are also tracked per tick.

Network Bandwidth Metrics

Every WebSocket message — sent and received — is now counted and sized by event type. This lets us answer questions like: “What percentage of bandwidth goes to enemy position broadcasts?” or “How many KB/s does a player in combat generate?” The data feeds into Prometheus for visualization.

F3 Debug Overlay

Admin users can now press F3 in-game to toggle a debug overlay showing live performance stats: FPS, frame delta, ping, sprite count, enemy count, remote players, estimated texture memory, WebSocket messages per second with bandwidth, current map key, and JS heap usage (Chrome). Press F3 again to hide it.

What’s Next

With baselines established, the next phases target the areas that matter most: server tick loop optimization, network protocol improvements, database query batching, and client-side rendering performance. The profiling data from this update will guide those priorities.

Play EchoQuest — free in your browser.