On Mon, Mar 31, 2008 at 10:22:40AM -0700, Stephen Hemminger wrote:Hi, Performance should not change too much. Uninlining of the functions has some impact, of course, but this should be visible only for small bitmap sizes. Measuring the performance impact by doing artificial benchmarks is a bit problematic too, because it is hard to guess what patterns are important. Anyhow, I hacked together a program (in userspace) that searches for a bit in a bitmap. In pseudo code: bitmap <- [0...] for bitmapsize=1 to 512 for bitposition=0 to bitmapsize-1 find_first_bit in bitmap bitmap[bitposition] <- 1 find_first_bit in bitmap bitmap[bitposition] <- 0 After each find_first_bit, the result is checked against the expected result. A similar test is done for searching zero bits. The two tests are performed 1000 times in a loop. On a 2.4GHz (P-IV-type) Xeon, I get the following results: $ gcc -DNEW -fomit-frame-pointer -Os find_first_bit.c && time ./a.out real 0m15.006s $ nm -nStd 0000000134513492 0000000000000065 T find_first_bit 0000000134513557 0000000000000062 T find_first_zero_bit 0000000134513619 0000000000000190 T testzerobit 0000000134513809 0000000000000187 T testonebit 0000000134513996 0000000000000045 T main and $ gcc -fomit-frame-pointer -Os find_first_bit.c && time ./a.out real 0m17.617s 0000000134513492 0000000000000293 T testzerobit 0000000134513785 0000000000000240 T testonebit 0000000134514025 0000000000000045 T main So in this particular case, on this particular machine, with this particular mix of searches, the new code is somewhat faster, even though it is out-of-line. A similar, but more convincing, change was seen when the assembly versions for find_next_bit and find_next_zero_bit where replaced by the generic ones. Greetings, Alexander --
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
| Linus Torvalds | Linux 2.6.21-rc1 |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| pageexec | Re: [stable] Linux 2.6.25.10 |
| Linus Torvalds | Re: [GIT]: Networking |
| Gerrit Renker | [PATCH 15/37] dccp: Set per-connection CCIDs via socket options |
| Natalie Protasevich | [BUG] New Kernel Bugs |
| Jarek Poplawski | [PATCH take 2] pkt_sched: Protect gen estimators under est_lock. |
git: | |
