I am using java key store to store and retrieve encryption key.It works faster while my key store size is small. But once my key store size is increased than key store operation
We have faced this issue when we were using safenet jar file as a key store provider, when I removed safenet as a provider & used default providers of java then I didn't face any performance related issue.
I have been facing the same issue related to execution speed varies with different operation system platform.
Jvm loads key store in memory. And its having hashtable collection as internal storage.
Hashtable is synchronized.
Whenever you perform get operation from key store, than it will return it from in-memory key store not from physical keystore. You can confirm it by using ("top" - %wa section) command in linux base OS.
Key store is using hashtable and it is the root cause behind performance decriment.
I have solved this issue by loading all keys from keystore into ConcurrentHashMap while initializing the project. and later on, All the read operation will be performed from MAP instead of keystore. And make sure that all write operation will be perform on both keystore and MAP.