Common reason is simply: RAM Cache.
- First run: it loads all everything into RAM and run it.
- Second run: it reuse the cached data on RAM.
Obviously your drive is slower than your RAM. So probably the bottle neck is your storage drive?
I doubt Firefox takes 40 minutes to start: