Commit 15325b4
committed
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>1 parent db73130 commit 15325b4
1 file changed
Lines changed: 7 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1241 | 1241 | | |
1242 | 1242 | | |
1243 | 1243 | | |
1244 | | - | |
1245 | | - | |
1246 | 1244 | | |
| 1245 | + | |
1247 | 1246 | | |
1248 | 1247 | | |
1249 | 1248 | | |
1250 | 1249 | | |
1251 | | - | |
1252 | | - | |
1253 | | - | |
1254 | | - | |
1255 | | - | |
1256 | | - | |
1257 | | - | |
| 1250 | + | |
1258 | 1251 | | |
1259 | 1252 | | |
1260 | 1253 | | |
| |||
1263 | 1256 | | |
1264 | 1257 | | |
1265 | 1258 | | |
1266 | | - | |
1267 | | - | |
1268 | | - | |
1269 | | - | |
1270 | | - | |
1271 | | - | |
1272 | | - | |
| 1259 | + | |
| 1260 | + | |
1273 | 1261 | | |
1274 | | - | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
1275 | 1265 | | |
1276 | 1266 | | |
1277 | 1267 | | |
| |||
0 commit comments