lynndylanhurley / lynndylanhurley/devise_token_auth
[Suggestion] Performance issue
- Dominant language
- Ruby
- Stars
- 3.6k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
Hello! First of all thank you for the great library!
I faced a performance issue recently and after profiling figured out that it mostly related to BCrypt.
Please refer https://github.com/codahale/bcrypt-ruby 'Cost Factors' section. Tuning default cost value from 10 to 6 improved performance for creating token_hash from 0.08s to 0.04s on my environment for each request. I went further and set it 1 and now it is better than 0.01s but I am not sure that security-wise it will work good for everybody but anyway default value for token authorization is huge overhead.
Kind regards,
Yuri.
Contributor guide
Research direction
Start with the BCrypt Cost Factors section linked in the issue and trace the token authorization path that uses the default cost. No file or test is named, so first locate where that default is configured and check for relevant coverage. Done should establish a safe default that addresses the reported performance concern without weakening authentication security.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rails, ruby
- Domain
- api, authentication
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100