Repository navigation
Make flushing trace_log under MSan 25% faster by disabling frame pointers for demangling - #91579
Conversation
|
Workflow [PR], commit [f7fd715] Summary: ❌
|
Algunenano
left a comment
There was a problem hiding this comment.
Let's see how it goes. Do you think it'd be an option to keep a small-ish cache of symbol -> demangled symbol? I'd expect most of the symbols, specially at the top of the tree, to appear over and over
…n for __cxa_demangle I've tested and demangling takes 50% of time, for 12K entries, 3.6s w/ demangle and 1.8-4sec w/o
81721fa to
b11cc93
Compare
I thought about this as well, but if this will work OK, we can do it separately, if not, will need to introduce some LRU-like cache Anyway this is the biggest change in terms of CUs :) |
| # Linking can fail due to relocation overflows (see #49145), caused by too big object files / libraries. | ||
| # Work around this with position-independent builds (-fPIC and -fpie), this is slightly slower than non-PIC/PIE but that's okay. | ||
| set (MSAN_FLAGS "-fsanitize=memory -fsanitize-memory-use-after-dtor -fsanitize-memory-track-origins -fno-optimize-sibling-calls -fPIC -fpie") | ||
| set (MSAN_FLAGS "${MSAN_FLAGS} -fsanitize-ignorelist=${PROJECT_SOURCE_DIR}/tests/msan_ignorelist.txt") |
There was a problem hiding this comment.
This function initializes its result, which means - if you no longer instrument it, you have to also unpoison the result.
There was a problem hiding this comment.
Interesting that I did not see any issues with it... But anyway, not required anymore
alexey-milovidov
left a comment
There was a problem hiding this comment.
Alternative solution is to disable demangling of trace_log under MSan.
…mentation for __cxa_demangle" The problem was not in MSan instrumentation, but in frame pointers This reverts commit b11cc93.
…inters) Disable frame pointers for libcxxabi to reduce demangle cost, llvm parser has some recursion there. This makes SYSTEM FLUSH LOGS 2x faster
|
Turns out the problem was due to frame-pointers, confirmed manually, works 2x faster |
Sure, but I want to avoid difference for MSan if possible, and now, w/o frame-pointers it does not have this overhead |
Algunenano
left a comment
There was a problem hiding this comment.
Why do we need to omit frame pointers when it's the default for the compiler and the project? Who's enabling them?
ClickHouse/cmake/sanitize.cmake Line 9 in 7d0b74a |
Changelog category (leave one):
Refs: #91410