First post, by Kronuz
- Rank
- Member
Hello everybody, finally this is my first patch for DOSBox, this patch significantly improves the performance of the scalers.
What I did is basically modify the scalers so they update only the parts of the screen that really changed since the last time they were processed.
This has an amazingly positive impact on some of the scalers and a clearly noticeable overall performance boost.
This are some numbers comparing the performance of the scalers before and after the patch (version 4 of the patch):
.................... Old ......... New ....... Imp.
Normal ......... 127.3 ........ 67 ......... 90%
Normal2x ...... 356 .......... 69 ......... 416%
AdvMame2x .. 825.5 ........ 72 ......... 1047%
AdvMame3x .. 1665 ......... 77 ......... 2062%
AdvInterp2x .. 841 .......... 72 ......... 1068%
Interp2x ....... 868 .......... 72 ......... 1106%
TV2x ........... 413.5 ........ 71 ......... 482%
Hq2x ........... 10480 ....... 109 ........ 9515%
TVHq2x ........ 10694 ....... 110 ........ 9622%
* timings are from the high-resolution performance counter
averaged over about 5000 frames and divided by 1,000,000.
(A 100% improvement is equivalent to twice the speed.)
Of course these numbers are for low action games... others, like DOOM, can give different numbers under stress:
.................... Old ......... New ....... Imp.
Normal ......... 130 ......... 79 .......... 65%
Normal2x ...... 354 ........ 104 ......... 239%
AdvMame2x .. 1146 ....... 191 ......... 500%
TVHq2x ....... 10890 ...... 959 ........ 1005%
(all my tests are made without frameskip and running at 8000 cycles on a P4 3Ghz, using the MS VC 7.1 compiler)
You can also get the patch at SourceForge with the name of "Scalers performance boost". I also included in the patch the Hq2x scaler by Moe, now optimized as well, a Normal3x scaler and modified versions of the Normal, Normal2x, AdvMame2x and Hq2x scallers with TV scanlines.
Just for recapitulation, in the latest version of the patch (version 8 ), Hq2x scaler went down from 109 to 89 in the numbers above, so I leave you as an exercise to do the math for the other scalers 😉
Version History:
+ Version 11b (still RC7) Small bugfix on OpenGL code.
+ Version 11 (RC7) TV mode added to the optimized scalers.
+ Version 10 (RC6) double buffer not supported; fixed minor bugs.
+ Version 9b (RC5) just added the exposure event
+ Version 9 (RC5) fixed the aspect correction, improved screen updates
+ Version 8 (RC4) updated region detection speed improvements
+ Version 7 (RC3) implemented gulikoza's suggestions
+ Version 6 (RC2) added modified-chunks "prediction"
+ Version 5 (RC1) fixes the toggle fullscreen/windowed issue.
+ Version 4 fixes the Warcraft 2 & other games issue
+ Version 3 fixes some artifacts and improves speed
+ Version 2 greatly improves the speed
!!! ATTENTION !!!
This (RC7) is now truly hopefully the last release candidate version; this is a call for everyone to stress-test the patch before it's officially released so that I can move to new areas of DOSBox optimization (if I can find some extra time). I'll be around at #dosbox
(Note: That my patch is officially released does NOT mean it will yet be in the cvs, if it ever makes it to the cvs at all.)
Kronuz.
Kronuz
"Time is of the essence"