Index: subversion/libsvn_ra/ra_loader.c
===================================================================
--- subversion/libsvn_ra/ra_loader.c	(revision 20926)
+++ subversion/libsvn_ra/ra_loader.c	(working copy)
@@ -143,6 +143,8 @@
     funcname = apr_psprintf(pool, "svn_ra_%s__init", ra_name);
     compat_funcname = apr_psprintf(pool, "svn_ra_%s_init", ra_name);
 
+    pool = svn_pool_create(NULL);
+
     /* find/load the specified library */
     status = apr_dso_load(&dso, libname, pool);
     if (status)
Index: subversion/libsvn_fs/fs-loader.c
===================================================================
--- subversion/libsvn_fs/fs-loader.c	(revision 20926)
+++ subversion/libsvn_fs/fs-loader.c	(working copy)
@@ -49,6 +49,7 @@
 #if APR_HAS_THREADS
 static apr_thread_mutex_t *common_pool_lock;
 #endif
+static apr_hash_t *dso_cache;
 
 
 /* --- Utility functions for the loader --- */
@@ -92,13 +93,41 @@
                            name, SVN_VER_MAJOR);
     funcname = apr_psprintf(pool, "svn_fs_%s__init", name);
 
-    /* Find/load the specified library.  If we get an error, assume
-       the library doesn't exist.  The library will be unloaded when
-       pool is destroyed. */
-    status = apr_dso_load(&dso, libname, pool);
+#if APR_HAS_THREADS
+    status = apr_thread_mutex_lock(common_pool_lock);
     if (status)
-      return SVN_NO_ERROR;
+      return svn_error_wrap_apr(status, _("Can't grab FS mutex"));
+#endif
 
+    dso = apr_hash_get(dso_cache, libname, APR_HASH_KEY_STRING);
+    if (! dso)
+      {
+        /* Find/load the specified library.  If we get an error, assume
+           the library doesn't exist.  The library will be unloaded when
+           global pool is destroyed. */
+        status = apr_dso_load(&dso, libname, common_pool);
+        if (status)
+          {
+#if APR_HAS_THREADS
+            status = apr_thread_mutex_unlock(common_pool_lock);
+            if (status)
+              return svn_error_wrap_apr(status, _("Can't ungrab FS mutex"));
+#endif
+            return SVN_NO_ERROR;
+          }
+
+        apr_hash_set(dso_cache,
+                     apr_pstrdup(common_pool, libname),
+                     APR_HASH_KEY_STRING,
+                     dso);
+      }
+
+#if APR_HAS_THREADS
+    status = apr_thread_mutex_unlock(common_pool_lock);
+    if (status)
+      return svn_error_wrap_apr(status, _("Can't ungrab FS mutex"));
+#endif
+
     /* find the initialization routine */
     status = apr_dso_sym(&symbol, dso, funcname);
     if (status)
@@ -245,7 +274,8 @@
   if (common_pool)
     return SVN_NO_ERROR;
 
-  common_pool = svn_pool_create(pool);
+  common_pool = svn_pool_create(NULL);
+  dso_cache = apr_hash_make(common_pool);
 #if APR_HAS_THREADS
   status = apr_thread_mutex_create(&common_pool_lock,
                                    APR_THREAD_MUTEX_DEFAULT, common_pool);
