Hey i am creating a rest api using webflux for learning purpose and i am stuck with bcrypt password matches at login page.
My login request is taking extra time and when i dig little more I found that matches function is a heavy task and time consuming and i am afraid that it could effect the entire applications performance
Below is my code
.filter(user -> {
long s = System.currentTimeMillis();
boolean matches = bCryptPasswordEncoder.matches(loginRequest.getPassword(), user.getPassword());
long e = System.currentTimeMillis();
System.out.println(e-s);
return matches;
})
My whole api response time is 70 ms and the time diff is printing 62, 63 it means matches is slowing down my entire application. what if i got 50 login request at a time. I wonder what is the proper way of doing this in non-blocking way.