vsprintf: rework bitmap_list_string
authorYury Norov <yury.norov@gmail.com>
Sat, 14 Aug 2021 21:17:13 +0000 (14:17 -0700)
committerYury Norov <yury.norov@gmail.com>
Sat, 2 Oct 2021 23:13:57 +0000 (16:13 -0700)
commit785cb064e2f87b6cd2157554f50193dba0642d75
tree52517cc6edf1cb88b93e1e5292bb2c35f26f842c
parent0ac8d21ff6c4c1f102c559cb6f1476a8424ba13a
vsprintf: rework bitmap_list_string

bitmap_list_string() is very ineffective when printing bitmaps with long
ranges of set bits because it calls find_next_bit for each bit in the
bitmap.  We can do better by detecting ranges of set bits.

In my environment, before/after is 943008/31008 ns.

Signed-off-by: Yury Norov <yury.norov@gmail.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
lib/vsprintf.c