office-gobmx/cppu
Stephan Bergmann ecf708e90d Avoid repeated calls cppu::detail::loadModule -> osl_getModuleURLFromAddress
...where the latter are reportedly expensive.  Both
<https://gerrit.libreoffice.org/#/c/75162/> "tdf#121740 related, cache external
mapping in cppu::loadExternal" and <https://gerrit.libreoffice.org/#/c/82261/>
"tdf#121740 add cache to win osl_getModuleURLFromAddress" attempted to reduce
the costs observed when loading one specific document by introducing caches
below cppu::detail::loadModule's call to osl::Module::loadRelative.

On the other hand, this change reduces the number of calls to
osl_getModuleURLFromAddress by computing the base URI in
cppu::detail::loadModule only once.  For my local Linux --enable-dbgutil build,
for `instdir/program/soffice '109340 class14.ppt'` and then exiting LO again
(with the document attached at
<https://bugs.documentfoundation.org/show_bug.cgi?id=121740#c0>), this reduces
the number of calls to osl_getModuleURLFromAddress from 3775 to 22.

(Many of those calls originated from cppu::getCaughtException or
cppu::throwException, as in

  osl_getModuleURLFromAddress
  osl_getModuleURLFromFunctionAddress
  osl::Module::getUrlFromAddress
  osl_loadModuleRelative
  osl::Module::loadRelative
  cppu::detail::loadModule
  cppu::loadModule
  cppu::loadExternalMapping
  uno_getMapping
  com::sun::uno::Mapping::Mapping
  cppu::throwException

.)

Unfortunately, this needs to duplicate functionality from osl_loadModuleRelative
(sal/osl/all/loadmodulerelative.cxx) somewhat, as the stable SAL interface only
offers functionality to load relative to a given function, not relative to a
given base URI.  (And extending the stable SAL interface for this one use is not
worth the maintenance costs.)

Change-Id: Ib58814136d11c67d1419b0224d12e30bb710e613
Reviewed-on: https://gerrit.libreoffice.org/82290
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-08 14:19:10 +01:00
..
qa
source Avoid repeated calls cppu::detail::loadModule -> osl_getModuleURLFromAddress 2019-11-08 14:19:10 +01:00
util
CppunitTest_cppu_any-external.mk
CppunitTest_cppu_qa_any.mk
CppunitTest_cppu_qa_recursion.mk
CppunitTest_cppu_qa_reference.mk
CppunitTest_cppu_qa_unotype.mk
CppunitTest_cppu_test_cppumaker.mk
InternalUnoApi_cppu_qa_cppumaker_types.mk
InternalUnoApi_cppu_qa_types.mk
IwyuFilter_cppu.yaml
Library_affine_uno_uno.mk
Library_cppu.mk
Library_log_uno_uno.mk
Library_purpenvhelper.mk
Library_unsafe_uno_uno.mk
Makefile
Module_cppu.mk
README

Type definitions/implementations for the core of UNO. The exported API is in C.

See also:
[http://wiki.openoffice.org/wiki/Uno/Binary/Modules/CPPU]