Bug 90 - Let's switch default scheduler implementation
Let's switch default scheduler implementation
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: core
pre-release
All All
: P3 normal
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-11 13:02 UTC by Gustavo J. A. M. Carneiro
Modified: 2007-11-15 00:35 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo J. A. M. Carneiro 2007-10-11 13:02:31 UTC
With default:

gjc@nazgul:ns-3-olsr-swlan$ time ./build/optimized/utils/bench-olsr --num-nodes 20 2> /dev/null 

real    0m38.673s
user    0m37.958s
sys     0m0.096s

With Simulator::SetStdMap ():

gjc@nazgul:ns-3-olsr-swlan$ time ./build/optimized/utils/bench-olsr --num-nodes 20 2> /dev/null 

real    0m6.404s
user    0m6.296s
sys     0m0.024s

The default scheduler is 6 times slower than StdMap!  The difference is so great it's not even funny anymore.  We should switch to StdMap or BinaryHeap ASAP.

Between StdMap and BinaryHeap the difference is very narrow:

gjc@nazgul:ns-3-olsr-swlan$ ## binary heap:
gjc@nazgul:ns-3-olsr-swlan$ time ./build/optimized/utils/bench-olsr --num-nodes 20 2> /dev/null 

real    0m6.368s
user    0m6.292s
sys     0m0.020s
gjc@nazgul:ns-3-olsr-swlan$ time ./build/optimized/utils/bench-olsr --num-nodes 20 2> /dev/null 

real    0m6.302s
user    0m6.276s
sys     0m0.008s
gjc@nazgul:ns-3-olsr-swlan$ time ./build/optimized/utils/bench-olsr --num-nodes 20 2> /dev/null 

real    0m6.346s
user    0m6.324s
sys     0m0.016s
gjc@nazgul:ns-3-olsr-swlan$ ## stdmap:
gjc@nazgul:ns-3-olsr-swlan$ time ./build/optimized/utils/bench-olsr --num-nodes 20 2> /dev/null 

real    0m6.470s
user    0m6.444s
sys     0m0.000s
gjc@nazgul:ns-3-olsr-swlan$ time ./build/optimized/utils/bench-olsr --num-nodes 20 2> /dev/null 

real    0m6.321s
user    0m6.272s
sys     0m0.016s
gjc@nazgul:ns-3-olsr-swlan$ time ./build/optimized/utils/bench-olsr --num-nodes 20 2> /dev/null 

real    0m6.158s
user    0m6.140s
sys     0m0.012s

The difference between them is about 0.2%, in which case I would advise to simply select the simplest implementation among stdmap and binary heap as default.
Comment 1 Mathieu Lacage 2007-10-11 14:53:47 UTC
ok. If we have to pick the simplest implementation, std::map wins.
Comment 2 Tom Henderson 2007-11-15 00:35:57 UTC
fixed as changeset 1827