The structure of your classpath can affect Derby startup time and the time required to load a particular class.
The classpath is searched linearly, so locate Derby's libraries at the beginning of the classpath so that they are found first. If the classpath first points to a directory that contains multiple files, booting Derby can be slow.
If you boot Derby with a modulepath, then this advice does not apply. Module contents are indexed at boot time. This eliminates the linear search when faulting in newly referenced classes.