Almost all profiles I see of dbgutil builds have lots of time spent in constructing and then discarding SAL_INFO type output via nested stream operators, a with lots of allocation & freeing going on too. That is true even when (as in the normal case) none of that information is actually output. It would be great to fix this by exposing the function: sal/osl/all/log.cxx: bool report(sal_detail_LogLevel level, char const * area) and giving it a sensible extern "C" name and wrapper eg. sal_detail_log_report - I suspect that will need a punch-through in the sal/ map file too checkout: sal/util/sal.map Then we should tweak the macros in the log headers: #define SAL_DETAIL_LOG_STREAM(condition, level, area, where, stream) \ do { \ if (condition) { \ (and friends) to do: if ((condition) && sal_detail_log_report((level),(area))) { \ ... instead - and (hopefully) hey-presto we save doing a ton of function calling just to discard the result. For bonus points we should create a wrapper of __builtin_expect - eg. SAL_UNLIKELY or SAL_LIKELY etc. to ensure that this code is annotated as ~never happening and thus piled up in some section elsewhere so it has a far smaller icache impact too =) Thanks !
Whether SAL_INFO generates code is controlled at build time with SAL_LOG_INFO macro (see solenv/gbuild/gbuild.mk for setting it). If it generates code, whether it generates output is controlled at runtime via SAL_LOG environment variable. Thus, if you want to reduce code size in your --enable-dbgutil build (and am sure you don't want to enable any SAL_INFO output), tweak the setting of the SAL_LOG_INFO macro in solenv/gbuild/gbuild.mk accordingly.
I saw the macros =) the ideal is to have the logging in-place, but have it burn much less CPU time so a better un-configured default (hopefully).
Yes, comment 1 was meant to be complementary to comment 0.
Migrating Whiteboard tags to Keywords: (easyHack, difficultyBeginner, skillCpp, topicCleanup)
JanI is default CC for Easy Hacks (Add Jan; remove LibreOffice Dev List from CC) [NinjaEdit]
Working on it
Arnold Dumas committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=b3a11c8f4f307bbbb597c9c6e7e61ee93e794873 tdf#91872: Make SAL_INFO and friends more efficient It will be available in 5.4.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
I think this bug can be marked as FIXED, because SAL_LIKELY and SAL_UNLIKELY have already been defined in e75406e54c57fc3113d4f1983249eb2aec0a3bcd.