-
Notifications
You must be signed in to change notification settings - Fork 28
Description
Hey!
Thanks for open-sourcing such a novel EFT tool- I use it every time I play 😄
Issue
I play on Streets and Shoreline a lot, taking dozens of screenshots to update my map position on tarkov.dev via remote connect.
The issue is this: the longer a raid goes on, and the more screenshots I take, the worse performance seems to get.
- each additional screenshot takes longer and longer between
screenshot taken >>> map updatedpipeline
Performance Profiling
I dug into why exactly this happens, by implementing some performance profiling on an experimental local branch. My north star here was measuring the milliseconds (ms) it took for each stage of the screenshot taken >>> map updated pipeline.
additional debugging & performance profiling details
I was using the built-in DEBUG profiler across a few different metrics:
MapUpdate_WebSocketSendto understand the transport cost as part of the overallscreenshot taken >>> map updatedpipelineScreenshotParseTimeto measure how long (inms) each screenshot took to parse for coordinate/heading/bearing metadataRaidDegradation_*indicators aka sequentialTimeToUpdatecost (inms) increases growing for every sequential screenshot
Findings
- In
GameWatcheron every screenshot event, files on disk are being counted via*.png. This operation grows in cost linearly, meaning the operation slows down progressively over the lifecycle of a long raid with lots of screenshots. - With
SocketClient.Sendthe websocket client is being created, started, then disposed for each screenshot event. Even if parsing is fast and payload creation is quick, we're paying the 100ms-400ms "transport" and TLS handshake costs every time, introducing latency.
Both of these are straightforward to fix, and I've successfully fixed them on my local with great results / very noticeable performance boosts. I'd like to issue some PRs for you to consider merging that would resolve issues 1 & 2?
screenshot taken >>> map updatedlatency went from an avg. of~800msto~300mson Streets~350msof the time-save came from the websocket persistence implementation itself
Proposed PRs
1.) Directory Enumeration Fix:
- remove the
*.pngpattern / directory enumeration - implement a low-cost "in-memory" store of screenshot filenames (for UX/cleanup)
2.) WebSocket Persistence During Raids:
- maintain a persistent WebSocket connection from raid start to raid end (event-driven)
- keep existing payload/schema the exact same
- if network is temporarily lost during a raid, attempt to reconnect and and resume and/or gracefully fail after
nattempts - pre-connect / lazy-connect upon raid start and disconnect cleanly at raid end
Very open to discussing how to go forward on this!
Cheers,
Mike