Ticket #143 (assigned enhancement)

Opened 3 years ago

Last modified 2 months ago

Improving osync_trace performance

Reported by: Olivier Berger <oberger@ouvaton.org> Assigned to: abauer (accepted)
Priority: low Milestone: 0.38
Component: OpenSync Version: 0.30
Severity: normal Keywords:
Cc:

Description

Reading the code, il seems that osync_trace will check environment every time it's called.

I suspect this is not optimal...

Maybe a pre-initialised func pointer (either directed to an already prepared trace function, or an empty stub if tracing is disabled in current execution environment) might be better.

Just in case someone would like to test that and performance impact...

My 2 cents.

Change History

09/07/06 17:31:09 changed by abauer

  • status changed from new to assigned.
  • version set to 0.30.

02/14/07 22:48:35 changed by dfriedrich

or we can make the trace function as a define. so if we build normal, we leave the define empty and have no function call wasted.

my cent.

02/14/07 23:49:28 changed by dgollub

Good idea. Actually this is already done :)

opensync_support.c:

osync_trace(..) {
#if ENABLE_TRACE
[...]
#endif
}

So it is a NOOP function if we disable TRACE while building. But we still very often we need the trace functions.. to get very detailed debugging information. So the idea from Oliver is might be a good idea to solve some performance issues also when it is compilied in..

10/15/07 23:25:51 changed by dgollub

  • milestone set to OpenSync 0.40.

06/12/08 17:05:53 changed by dgollub

  • milestone changed from 0.40 to 0.38.

IIRC, there were already some performance improvements. Most expensive calls are now the getenv() calls which are done for each osync_trace() call.

Could anyone have a look on this getenv() calls if those could be done _once_?

The rest is disk I/O, to workaround here bad performance just setup a tmpfs and set OSYNC_TRACE to the tmpfs.