67d59e2b4bafe13392a50b48cd664c6ed195323f 3006 |
|
11-Sep-2007 |
neil_a_wilson |
Make a number of relatively simple changes to provide basic performance
improvements, including:
- Replace occurrences of StringBuffer with StringBuilder. As of Java 5,
StringBuilder is almost always a better choice than StringBuffer because it
provides all the same methods but doesn't have the synchronization overhead.
- Update the JE backend DN2URI class (which is responsible for keeping track of
smart referrals in the database) to keep track of whether there are any
referrals in the underlying database so that it doesn't go to the DB if it
can be certain that there aren't any referrals to get.
- Update the JE backend ImportJob class to provide a simple cache for parent ID
lookups so that it can avoid the need to go to the underlying DB to get the
entry ID for a parent entry if it's contained in the cache.
- Update the salted password storage scheme variants so that they use an
instance of java.util.Random rather than java.security.SecureRandom to
generate the salt. There really isn't a need for a cryptographic-quality
random number generator for salt generation, and the java.util.Random
implementation is much faster than the java.security.SecureRandom
implementation.
- Update the DN class to return a reference to the precomputed NULL_DN instead
of creating a new DN with zero RDN components when decoding DNs from strings
or octet strings. Also, use LinkedList rather than ArrayList for temporary
storage of RDN values to avoid the hit of allocating memory that we may not
need.
- Update the Entry class to cache the result of LDIFImportConfig.typesOnly(),
which has been observed to slightly improve MakeLDIF performance.
- If Java 6 is available, then prefer using it to set file permissions over
Runtime.exec() on UNIX systems. Even though it's potentially less
fine-grained than using exec to call chmod, it's faster and safer to use the
Java methods if they're available. |