I am using jbcrypt for hash passwords in a project. Performance is around 500 ms when checking passwords on the hardware I use (log_rounds is set to 12). However, after some time with regular use, the execution time suddenly drops to a whopping 15 seconds. The drop is very sudden without buildup and remains constant until the process is restarted.
Profiling shows that extra time is used in the key method (..).
Source: http://jbcrypt.googlecode.com/svn/tags/jbcrypt-0.3m/src/main/java/org/mindrot/jbcrypt/BCrypt.java
This method only calculates the hash using basic functions like xor, and shift, etc. No object assignments, use of external resources, random number generation, etc.
Performance is not reduced for other functions in the same process. The memory allocation is stable and low. Full GC is not involved.
Has anyone seen this before or any clue to why this is happening? I could understand the variable performance, which to some extent depended on other circumstances, but this is a very sudden and stable drop from about 500 ms. up to about 15000 ms.
source share