Comment 47 for bug 686028

Revision history for this message
In , Sbergman (sbergman) wrote :

Fixed as <http://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-3-5&id=cbc1ddba1bbe8843e0b31d39cb5c04f7b6518925> "Confine JDBC driver to thread-affine apartment for Java 6 performance."

From <http://nabble.documentfoundation.org/Trying-to-diagnose-base-running-extremely-slowly-tp3426499p3653136.html>:

"One rather easy fix would be to confine the
com.sun.star.comp.sdbc.JDBCDriver UNO code to a thread-affine apartment,
see the attached patch. That way, all code related to this UNO service
(which is the code that calls Attach/DetachCurrentThread so frequently
and thus causes the performance degradation) is run in a single,
dedicated thread.

"That thread is guaranteed not to be the main thread (as the
thread-affine apartment explicitly creates it), so JVM versions that
include the fix for
<http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6978641> 'Fix for
6929067 introduces additional overhead in thread creation/termination
paths' (which significantly reduces the overhead of
Attach/DetachCurrentThread for all but the main thread again) should
return to an acceptable performance. Trying it out on Fedora 16, which
includes version 1.6.0_22 of OpenJDK, the patch noticeably improves
performance of the test scenario described at
<https://bugzilla.redhat.com/show_bug.cgi?id=661738#c0>.

[...]

"I did not find problems with using the thread-affine apartment, but then
again my Base skills are virtually non-existent, so this would probably
need some QA. However, there is also already another SDBC driver that
uses the thread-affine apartment, namely the Windows-specific ADO driver
(com.sun.star.comp.sdbc.ado.ODriver)."

So, please somebody QA the Base JDBC driver thoroughly.