You cannot use the same PersistenceManagerFactory for different databases.
Conventional use of ObjectDB usually doesn't involve working with so many odb files at the same time, so ObjectDB was never optimized for this purpose.
I tried a modified version of the test above that opens 10 copies of your database:
import javax.jdo.*;
public final class T976 {
public static void main(String[] args) {
for (int ix = 0; ix < 9; ix++) {
long time = System.currentTimeMillis();
PersistenceManagerFactory pmf =
JDOHelper.getPersistenceManagerFactory(
"$objectdb/db/LogTestRunV2_" + ix + ".odb");
System.out.println("Obtaining PersistenceManagerFactor: " +
(System.currentTimeMillis() - time));
time = System.currentTimeMillis();
PersistenceManager pm = pmf.getPersistenceManager();
System.out.println("Obtaining PersistenceManager: " +
(System.currentTimeMillis() - time));
pm.close();
pmf.close();
}
}
}
The results are better than what you got:
Obtaining PersistenceManagerFactor: 565
Obtaining PersistenceManager: 688
Obtaining PersistenceManagerFactor: 1
Obtaining PersistenceManager: 202
Obtaining PersistenceManagerFactor: 1
Obtaining PersistenceManager: 182
Obtaining PersistenceManagerFactor: 2
Obtaining PersistenceManager: 158
Obtaining PersistenceManagerFactor: 2
Obtaining PersistenceManager: 112
Obtaining PersistenceManagerFactor: 1
Obtaining PersistenceManager: 149
Obtaining PersistenceManagerFactor: 2
Obtaining PersistenceManager: 149
Obtaining PersistenceManagerFactor: 1
Obtaining PersistenceManager: 105
Obtaining PersistenceManagerFactor: 1
Obtaining PersistenceManager: 84
Apparently most time is spent on looking for classes and JDO metadata in the classpath (for synchronization with the database), and this could be optimized. However, any further work will require a more realistic test that reflects your real database and includes classes, JDO metadata, etc.