Skip to content

Commit fe350c9

Browse files
committed
Tweak readme
1 parent 05b09f1 commit fe350c9

File tree

1 file changed

+2
-32
lines changed

1 file changed

+2
-32
lines changed

README.md

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -53,39 +53,9 @@ I aim for 100% test coverage and have fuzz tested quite extensively. But please
5353

5454
### Performance and benchmarking
5555

56-
The hashids implementation is being optimised for performance and memory usage. Compared to the original `hashids` gem,
57-
the `encoded_id` gem is faster and uses less memory. The exact performance difference depends on the length of the encoded string
58-
and other factors.
56+
This gem uses a custom HashId implementation that is significantly faster and more memory-efficient than the original `hashids` gem.
5957

60-
### Encoding comparison vs `hashids` gem
61-
62-
See `bin/benchmark`
63-
64-
`hashids` gem, no YJIT: `length 8: 69569.5 i/s`
65-
66-
`encoded_id`, no YJIT: `length 8: 97085.8 i/s - 1.4x faster`
67-
68-
or with YJIT enabled, the effect is more pronounced:
69-
70-
`hashids` gem, YJIT: `length 8: 109341.5 i/s`
71-
72-
`encoded_id`, YJIT: `length 8: 223661.0 i/s - 2.3x faster`
73-
74-
##### Memory allocations
75-
76-
See `bin/memory_profile`.
77-
78-
For a small input (2 integers):
79-
80-
`hashids` gem: `Total allocated: 7456 bytes (120 objects)`
81-
82-
`encoded_id` gem: `Total allocated: 848 bytes (8 objects)`
83-
84-
But with a 100 integer array input, the difference is huge (37x difference):
85-
86-
`hashids` gem: `Total allocated: 413264 bytes (5998 objects)`
87-
88-
`encoded_id` gem: `Total allocated: 11024 bytes (204 objects)`
58+
For detailed benchmarks and performance metrics, see the [Custom HashId Implementation](#custom-hashid-implementation) section at the end of this README.
8959

9060

9161
### Rails support `encoded_id-rails`

0 commit comments

Comments
 (0)