Open exiledagain opened 6 months ago
When I ran a replacement benchmark previously, the peak timing was very small. After testing more, the timings can be quite high. The Visual Studio profiler showed that most time was spent in creating the regex and searching for the matches. Simply putting a static initialized variable and making the regex static was only ~5-6x slower than this patch.
Refactored solution similar timing: filter | method | min | max | avg (ms) |
---|---|---|---|---|
kassahi meme hype | old | 0.0498 | 4.2516 | 0.112722 |
kassahi meme hype | new | 0.0012 | 0.4384 | 0.003889 |
eqN | old | 0.0513 | 1.4403 | 0.103337 |
eqN | new | 0.0012 | 0.3343 | 0.004782 |
PiLLLaa hype s9 | old | 0.0531 | 7.4987 | 0.126096 |
PiLLLaa hype s9 | new | 0.0012 | 1.6199 | 0.005543 |
Hiim | old | 0.0465 | 2.5609 | 0.105658 |
Hiim | new | 0.0008 | 0.3365 | 0.003631 |
Kryszard | old | 0.0488 | 9.8758 | 0.113132 |
Kryszard | new | 0.0012 | 0.3629 | 0.004542 |
I'll review this before the next upcoming season
Removed COLOR_REPLACEMENTS
as it was no longer used, fixed merged conflicts around nlAllowed
, and added transparency colors. I don't think I have the right gfx version so I didn't see any transparent text, but the filters gave the same output.
Removed
COLOR_REPLACEMENTS
as it was no longer used, fixed merged conflicts aroundnlAllowed
, and added transparency colors. I don't think I have the right gfx version so I didn't see any transparent text, but the filters gave the same output.
The transparency options require the latest compiled version of the pd2 d2gl branch as well.
This is a ~25x average speed-up for variable substitution in the loot filter for names.
I have included commits for microbenchmark and comparison between the two results. Every 1000 rules will write results to a file called
debug_new.txt
anddebug_old.txt
as well as printing the statistics in-game.