Bugzilla – Bug 901
Optimize Mac48Address < != and ==
Last modified: 2010-07-21 09:35:29 UTC
Created attachment 853 [details] patch Mac48Address operators can be greatly optimized by always using memcmp and making them inline. Here's a micro-benchmark: gjc@dark-tower:ns-3-dev$ time ./build/optimized/utils/bench-mac48 1000000000 real 0m14.926s user 0m14.810s sys 0m0.020s gjc@dark-tower:ns-3-dev$ time ./build/optimized/utils/bench-mac48 1000000000 real 0m14.921s user 0m14.820s sys 0m0.030s gjc@dark-tower:ns-3-dev$ time ./build/optimized/utils/bench-mac48 1000000000 real 0m14.893s user 0m14.820s sys 0m0.010s ============== with the patch =========== gjc@dark-tower:ns-3-dev$ time ./build/optimized/utils/bench-mac48 1000000000 real 0m1.136s user 0m1.120s sys 0m0.000s gjc@dark-tower:ns-3-dev$ time ./build/optimized/utils/bench-mac48 1000000000 real 0m1.146s user 0m1.140s sys 0m0.000s gjc@dark-tower:ns-3-dev$ time ./build/optimized/utils/bench-mac48 1000000000 real 0m1.136s user 0m1.130s sys 0m0.000s
Created attachment 854 [details] benchmark
Ping? This seems like a no-brainer: clear speedup, small patch...
+1
changeset 406385ce683c