Bugzilla – Full Text Bug Listing |
Summary: | Optimize Mac48Address < != and == | ||
---|---|---|---|
Product: | ns-3 | Reporter: | Gustavo J. A. M. Carneiro <gjcarneiro> |
Component: | network | Assignee: | ns-bugs <ns-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | craigdo, tomh |
Priority: | P5 | ||
Version: | ns-3-dev | ||
Hardware: | All | ||
OS: | All | ||
Attachments: |
patch
benchmark |
Created attachment 854 [details]
benchmark
Ping? This seems like a no-brainer: clear speedup, small patch... +1 changeset 406385ce683c |
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