With PBKDF2 support enabled all the time: 1min 20sec
With PBKDF2 only set for the test that test its effectiveness: 35sec
The difference is the highlighted line below (first in the SetupDatabase method)
That is an extension method that sets the DEFAULT_PBKDF2_INTERACTIONS value
which is used to create the hash value for the user’s password
The reason this simple change makes a massive difference is because most TeamMentor server-side unit tests use a in-memory database (with at least one admin user), with some tests creating new users in order to perform specific tests.
For example, the test:
will create 3 users and execute in about 4 sec with 1 DEFAULT_PBKDF2_INTERACTIONS
and in 5 sec with 20000 DEFAULT_PBKDF2_INTERACTIONS (which is the default value when TM is running)
Why the 1sec delay?
At the moment the PBKDF2 value was chosen so that the calculation value takes between 200ms and 400ms (to give us security without a big performance impact)
Which means that this UnitTest will create 3 users which will run the PBKDF2 calculation 3 times (once per user)