[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libunwind-devel] Increasing the DWARF_UNW_CACHE_SIZE
From: |
Milian Wolff |
Subject: |
[Libunwind-devel] Increasing the DWARF_UNW_CACHE_SIZE |
Date: |
Mon, 25 Aug 2014 13:34:22 +0200 |
User-agent: |
KMail/4.14 (Linux/3.16.1-1-ARCH; KDE/4.14.0; x86_64; ; ) |
Hey all,
looking at the performance of my malloc tracer which calls unw_backtrace on
every call to malloc and friends, I noticed that I can greatly improve the
runtime overhead by tuning DWARF_LOG_UNW_CACHE_SIZE. Currently it's set to 7
and sizeof(struct dwarf_rs_cache) = 43568 bytes. When I run my tracer on an
example application (KDE4's Kate opening a blank file and closing it directly
afterwards), I see ca. 190k cache misses. I played around with it and when I
set DWARF_LOG_UNW_CACHE_SIZE = 10, leading to an increased cache size of
348208 bytes, the cache misses drop do ca. 50k. The performance impact is
noticeable.
I assume that I cannot easily provide a patch to increase the cache size as it
currently lives on the stack and libunwind wants to run on embedded devices
with limited amounts of memory as well. That said, on desktop machines with
gigs of ram, using one or two megabytes of ram to greatly improve the
performance of a profiler is something I'd gladly do.
So, what can we do about this situation? Could the cache be created on the
heap and a function made public which can be called to tune the size of the
cache, similar to unw_set_caching_policy? I'd welcome something like
unw_set_dwarf_cache_size(unsigned long) or similar, which could then be set to
a specific size.
Would a patch with something like the above be accepted or is a cache on the
heap a no-go here?
Bye
--
Milian Wolff
address@hidden
http://milianw.de
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Libunwind-devel] Increasing the DWARF_UNW_CACHE_SIZE,
Milian Wolff <=