Commit time has a major influence on all db4o operations. Commit is generally a slow operation as it requires physical disk access. The following example shows how the frequency of commits affects the delete performance:
The following initial setup is used:
Delete procedures are as follows:
Item class used in this example has depth = 3:
The results on the test computer are:
Delete test with different commit frequency
Test delete all:
Store 30000 objects: 2432ms
Deleted all objects: 3731ms
Test delete all with commit after each 1000 objects:
Store 30000 objects: 2103ms
Deleted all objects: 8615ms
You can see that the time required for deletion increased with the amount of commits. To improve the performance commit frequency should be kept relatively low, in the same time it must ensure the integrity of the logical transactions.
Download example code: