Timed event optimization#142
Conversation
maehne
left a comment
There was a problem hiding this comment.
This PR modifies the public interface of sc_event by adding member function sc_event::cancel_timed() and member variable sc_event::m_event_with_the_same_stamp of raw pointer type sc_event*. It also modifies the signature of sc_simcontext::add_timed_event() and adds sc_ppq_base::operator[](). These modifications expose implementation details of the SystemC PoC library and change its public interface and therefore risk to break other libraries relying on SystemC.
Did you run at least the regression test suites of SystemC and its companion libraries maintained by the Accellera working groups to check what impact have your changes? If the performance gains are worthwhile without breaking the semantics defined in the SystemC LRM, it should be checked how to implement this optimisation without changing the public interface of the library.

merge timed events that have the same future simulation time inside timed event queue,
decrease heapify operations and saves around 9% to 15% time in my use case where there are lots of timed events with the same time. The time saved may vary due to different production environment.