Change in libosmocore[master]: bits.c: Use faster look-up-table approach for osmo_revbytebits_{buf, u8}

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Sun Aug 2 09:30:44 UTC 2020


Hello Jenkins Builder, 

I'd like you to reexamine a change. Please visit

    https://gerrit.osmocom.org/c/libosmocore/+/19497

to look at the new patch set (#2).

Change subject: bits.c: Use faster look-up-table approach for osmo_revbytebits_{buf,u8}
......................................................................

bits.c: Use faster look-up-table approach for osmo_revbytebits_{buf,u8}

Benchmarking has shown that a look-up table based approach is much
faster than the arithmetic approach we used so far.

This is from a Core i7-6600U:

10    bytes, 1     iterations: flip=379, revb=5491; revb = 1448 %
10    bytes, 10    iterations: flip=728, revb=1517; revb = 208 %
10    bytes, 100   iterations: flip=2952, revb=9305; revb = 315 %
10    bytes, 1000  iterations: flip=26305, revb=90953; revb = 345 %
100   bytes, 1     iterations: flip=468, revb=1093; revb = 233 %
100   bytes, 10    iterations: flip=2634, revb=7418; revb = 281 %
100   bytes, 100   iterations: flip=23666, revb=70718; revb = 298 %
100   bytes, 1000  iterations: flip=237595, revb=900555; revb = 379 %
1024  bytes, 1     iterations: flip=3417, revb=11454; revb = 335 %
1024  bytes, 10    iterations: flip=33579, revb=92353; revb = 275 %
1024  bytes, 100   iterations: flip=555399, revb=1196228; revb = 215 %
1024  bytes, 1000  iterations: flip=3478271, revb=9227966; revb = 265 %
1048576 bytes, 1     iterations: flip=10189583, revb=7022193; revb = 68 %
1048576 bytes, 10    iterations: flip=19693347, revb=54389925; revb = 276 %
1048576 bytes, 100   iterations: flip=151308243, revb=454293151; revb = 300 %
1048576 bytes, 1000  iterations: flip=1390338439, revb=4429862642; revb = 318 %

where 'revb' is the old arithmetic approach, and 'flip' the new
look-up-table approach. In our usual cases of 100..1024 bytes in a
single iteration, the old code takes 233..335% of the look-up table.

Benchmarks on an Atom E6xx also show improvements except in one
situation (a single iteration over one 1MB large buffer).

10    bytes, 1     iterations: flip=416, revb=9184; revb = 2207 %
10    bytes, 10    iterations: flip=1960, revb=4024; revb = 205 %
10    bytes, 100   iterations: flip=13624, revb=32408; revb = 237 %
10    bytes, 1000  iterations: flip=160656, revb=361784; revb = 225 %
100   bytes, 1     iterations: flip=3536, revb=4952; revb = 140 %
100   bytes, 10    iterations: flip=12960, revb=20912; revb = 161 %
100   bytes, 100   iterations: flip=122448, revb=215152; revb = 175 %
100   bytes, 1000  iterations: flip=1204928, revb=1647680; revb = 136 %
1024  bytes, 1     iterations: flip=12944, revb=23128; revb = 178 %
1024  bytes, 10    iterations: flip=126192, revb=239784; revb = 190 %
1024  bytes, 100   iterations: flip=1190184, revb=1491672; revb = 125 %
1024  bytes, 1000  iterations: flip=11865872, revb=15113872; revb = 127 %
1048576 bytes, 1     iterations: flip=16288272, revb=15925888; revb = 97 %
1048576 bytes, 10    iterations: flip=121957000, revb=157883384; revb = 129 %
1048576 bytes, 100   iterations: flip=1219264992, revb=1621265216; revb = 132 %
1048576 bytes, 1000  iterations: flip=12219520648, revb=15960035856; revb = 130 %

Change-Id: I25029fe7e54c92979fb0119992fb8dc167e1536e
---
M src/bits.c
1 file changed, 32 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/97/19497/2
-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/19497
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I25029fe7e54c92979fb0119992fb8dc167e1536e
Gerrit-Change-Number: 19497
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200802/d909f2f6/attachment.htm>


More information about the gerrit-log mailing list