-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Looking at the source code in xml_writer.cs, there are some very easy ways to optimize this code to run much faster.
- Instead of System.Windows.Forms.Timer class, which is from the Stone Age of C#, use the System.Diagnostics.Stopwatch class to make a timer. (https://tekeye.uk/visual_studio/high-speed-regular-events-in-c-sharp). Timer can't go faster than every 16 ms.
- getVSData() should be executed in its own thread instead of in the event thread. Spawn the thread when this addin is loaded. Every time the timerTick goes off, push the x,y,timestamp data into a thread-safe queue. The thread can drain this queue and process the x,y location.
- Have the getVSData() function write its mapping (line number, column) into a thread-safe queue.
- Disk access doesn't need to be in the event thread. Have another thread drain the output queue and write XML to disk.
This should remove significant bottlenecks from the code.
Metadata
Metadata
Assignees
Labels
No labels