dos33fsprogs/pt3_player/OPTIMIZATION.txt
Vince Weaver ae3d819970 pt3: init zeroed vars with loop
switching songs, sometimes they'd start wrong due to vars not
being initialized.  Easier to just zero everything than try to
figure out which field we weren't getting.  Also makes code smaller.
2019-06-08 01:39:50 -04:00

49 lines
1.5 KiB
Plaintext

Code Optimization
~~~~~~~~~~~~~~~~~
The original working code is about 4k (not counting the pt3 file)
and has an overhead of roughly 20% when playing a song interrupt-driven
at 50Hz.
I'm keeping some stats here as I try to optimize the size and speed.
Song: "Summer of Rain" SR.PT3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lz4 compressed
pt3 size: raw size: ym5 size: pt3.lz4:
3871 137015 7637 1793
Size=pt3lib_end - note_a
Decoder Type size ZP use raw decode total CPU overhead
-------------------------------------------------------------
Original 3407 22B 1F.22 31s 171s 18%
VolTableGen 3302 22B 20.0E 32s 171s 19%
SizeOpts 3262 22B 20.0A 32s 171s 19%
MoreSizeOpt 3203 22B 1F.1D 31s 171s 18%
Qkumba#1 2937 ?? 1D.18 29s 171s 17%
Qkumba#2 2879 ?? 1C.18 28s 171s 16%
Qkumba#3+vmw 2816 ?? 1C.22 28s 171s 16%
Fixes,zero init 2776 ?? 1C.10 28s 171s 16%
Times: Validated
BH.PT3: 10.0B 16 1:33 93 17.2%
CH.PT3: 1D.12 29 2:49 169 17.2%
CR.PT3: 0F.25 15 1:30 90 16.7% Yes
DF.PT3: 19.1C 25 2:27 147 17.0%
EA.PT3: 1E.13 30 2:53 173 17.3% Yes
F4.PT3: 18.1D 24 2:16 136 17.6%
FC.PT3: 20.24 32 3:12 192 16.7%
FR.PT3: 0B.0A 11 1:01 61 18.0%
HI.PT3: 11.19 17 1:34 94 18.0%
I2.PT3: 1E.0C 30 2:59 179 16.8%
IT.PT3: 16.19 22 2:11 131 16.8% Yes
MB.PT3: 14.08 20 1:59 119 16.8%
ND.PT3: 14.1C 20 1:52 112 17.9%
OS.PT3: 13.24 19 1:48 108 17.6%
RI.PT3: 0F.03 15 1:26 86 17.4%
SD.PT3: 11.16 17 1:40 100 17.0%
SR.PT3: 1F.22 31 2:51 171 18.1%
VC.PT3: 1B.20 27 2:40 160 16.9%