Repository navigation
Lower bcrypt cost in tests to speed up the suite - #27
Merged
Merged
Conversation
Set BCrypt::Engine.cost to the minimum in test_helper so fixtures and has_secure_password digests stop hashing at the default cost (12). This roughly halves the suite's CPU time and speeds up password-touching specs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sets
BCrypt::Engine.costto the minimum intest_helper.rbso the users fixture andhas_secure_passworddigests (registration and password-reset specs) stop hashing at the default cost of 12. Each cost-12 hash burns ~0.5s of CPU on this hardware, so this roughly halves the suite's CPU time and speeds up password-touching specs — a benefit that grows on single-core CI runners and as the suite grows. Production hashing is unaffected since the change is test-env only.🤖 Generated with Claude Code