Ticket #143 (closed enhancement: invalid)
[NEEDINFO] Improving osync_trace performance
| Reported by: | Olivier Berger <oberger@…> | Owned by: | abauer |
|---|---|---|---|
| Priority: | low | Milestone: | |
| Component: | OpenSync | Version: | 0.38 |
| 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
comment:2 Changed 5 years ago 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.
comment:3 Changed 5 years ago 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..
comment:6 Changed 4 years ago 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.
comment:7 Changed 3 years ago by dgollub
- Milestone 0.38 deleted
As workaround for such issue i could highly recommend to log traces files into a tmpfs. Rescheduling this due to timing/scheduling issue.
comment:8 Changed 3 years ago by tuju
- Version changed from 0.30 to 0.38
- Summary changed from Improving osync_trace performance to [NEEDINFO] Improving osync_trace performance
dgollub, i think you fixed this already? Closing in 30 days if no answer.
comment:9 Changed 3 years ago by niels
- Status changed from assigned to closed
- Resolution set to invalid
Closing as no more information has been provided within 30 days.
If you are still experiencing the originally reported problem, please (re-) open this / a new ticket with the requested information.
