<p>laforge <strong>uploaded patch set #2</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/19497">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bits.c: Use faster look-up-table approach for osmo_revbytebits_{buf,u8}<br><br>Benchmarking has shown that a look-up table based approach is much<br>faster than the arithmetic approach we used so far.<br><br>This is from a Core i7-6600U:<br><br>10    bytes, 1     iterations: flip=379, revb=5491; revb = 1448 %<br>10    bytes, 10    iterations: flip=728, revb=1517; revb = 208 %<br>10    bytes, 100   iterations: flip=2952, revb=9305; revb = 315 %<br>10    bytes, 1000  iterations: flip=26305, revb=90953; revb = 345 %<br>100   bytes, 1     iterations: flip=468, revb=1093; revb = 233 %<br>100   bytes, 10    iterations: flip=2634, revb=7418; revb = 281 %<br>100   bytes, 100   iterations: flip=23666, revb=70718; revb = 298 %<br>100   bytes, 1000  iterations: flip=237595, revb=900555; revb = 379 %<br>1024  bytes, 1     iterations: flip=3417, revb=11454; revb = 335 %<br>1024  bytes, 10    iterations: flip=33579, revb=92353; revb = 275 %<br>1024  bytes, 100   iterations: flip=555399, revb=1196228; revb = 215 %<br>1024  bytes, 1000  iterations: flip=3478271, revb=9227966; revb = 265 %<br>1048576 bytes, 1     iterations: flip=10189583, revb=7022193; revb = 68 %<br>1048576 bytes, 10    iterations: flip=19693347, revb=54389925; revb = 276 %<br>1048576 bytes, 100   iterations: flip=151308243, revb=454293151; revb = 300 %<br>1048576 bytes, 1000  iterations: flip=1390338439, revb=4429862642; revb = 318 %<br><br>where 'revb' is the old arithmetic approach, and 'flip' the new<br>look-up-table approach. In our usual cases of 100..1024 bytes in a<br>single iteration, the old code takes 233..335% of the look-up table.<br><br>Benchmarks on an Atom E6xx also show improvements except in one<br>situation (a single iteration over one 1MB large buffer).<br><br>10    bytes, 1     iterations: flip=416, revb=9184; revb = 2207 %<br>10    bytes, 10    iterations: flip=1960, revb=4024; revb = 205 %<br>10    bytes, 100   iterations: flip=13624, revb=32408; revb = 237 %<br>10    bytes, 1000  iterations: flip=160656, revb=361784; revb = 225 %<br>100   bytes, 1     iterations: flip=3536, revb=4952; revb = 140 %<br>100   bytes, 10    iterations: flip=12960, revb=20912; revb = 161 %<br>100   bytes, 100   iterations: flip=122448, revb=215152; revb = 175 %<br>100   bytes, 1000  iterations: flip=1204928, revb=1647680; revb = 136 %<br>1024  bytes, 1     iterations: flip=12944, revb=23128; revb = 178 %<br>1024  bytes, 10    iterations: flip=126192, revb=239784; revb = 190 %<br>1024  bytes, 100   iterations: flip=1190184, revb=1491672; revb = 125 %<br>1024  bytes, 1000  iterations: flip=11865872, revb=15113872; revb = 127 %<br>1048576 bytes, 1     iterations: flip=16288272, revb=15925888; revb = 97 %<br>1048576 bytes, 10    iterations: flip=121957000, revb=157883384; revb = 129 %<br>1048576 bytes, 100   iterations: flip=1219264992, revb=1621265216; revb = 132 %<br>1048576 bytes, 1000  iterations: flip=12219520648, revb=15960035856; revb = 130 %<br><br>Change-Id: I25029fe7e54c92979fb0119992fb8dc167e1536e<br>---<br>M src/bits.c<br>1 file changed, 32 insertions(+), 26 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/97/19497/2</pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/19497">change 19497</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/libosmocore/+/19497"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I25029fe7e54c92979fb0119992fb8dc167e1536e </div>
<div style="display:none"> Gerrit-Change-Number: 19497 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>