|Anonymous | Login||2021-10-22 01:23 UTC|
|My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000022||OMNeT++||simulation kernel||public||2008-12-05 16:11||2009-07-25 17:38|
|Target Version||Fixed in Version||4.1|
|Summary||0000022: Perfomance issue: cMessage::getArrivalTime() returns simtime_t by value|
|Description||cMessage::getArrivalTime() returns simtime_t by value. This is a performance problem especially for the FES (shiftup and insert).|
After changing the method to return const simtime_t& we had performance improvements of about 10-20 percent (compiled with -O3).
Probably this should be changed for all simtime_t setters and getters in cmessage.h.
|Tags||No tags attached.|
|Attached Files||simtime_by_reference.diff [^] (941 bytes) 2009-03-10 12:03 [Show Content]|
edited on: 2009-07-25 13:24
I did some measurements as well, with interesting results.
cqn example (100 tandems, 50 queues/tandem), cmdenv express mode, ubuntu 32-bit, g++ 4.3.2.
In debug mode (make MODE=debug), I saw the performance hit you described (~ 15-20% spent in getArrivalTime()).
In release builds (-O2), this difference disappeared:
kcachegrind runs showed similar results (difference was only ~0.2%).
Still, going on with the change looks like a good idea, because debug builds benefit a lot.
It is an interesting question how this would affect performance on 64-bit architectures, where a SimTime object fits into a single machine register. There, returning a reference (which is actually a pointer) instead of the value might be a performance penalty. I did not make measurements in this direction yet. However, today most users are still on 32-bit architectures, so the change would benefit them.
|Introduced simtime_t_retval which is a typedef for const simtime_t&, and changed cMessage method return types to that. Via simtime_t_retval, it will be easy to turn off this optimization when it adversely affects performance (i.e. 64-bit optimized builds)|
|2008-12-05 16:11||baumgart||New Issue|
|2009-03-10 12:03||baumgart||File Added: simtime_by_reference.diff|
|2009-07-25 13:22||andras||Note Added: 0000160|
|2009-07-25 13:23||andras||Assigned To||=> andras|
|2009-07-25 13:23||andras||Status||new => in work|
|2009-07-25 13:24||andras||Note Edited: 0000160|
|2009-07-25 17:38||andras||Note Added: 0000161|
|2009-07-25 17:38||andras||Status||in work => resolved|
|2009-07-25 17:38||andras||Fixed in Version||=> 4.1|
|2009-07-25 17:38||andras||Resolution||open => fixed|
|Copyright © 2000 - 2021 MantisBT Team|