Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⚡️ Drop some unneeded allocs in ulid #4088

Merged
merged 2 commits into from
Jul 19, 2023
Merged

Conversation

dubzzz
Copy link
Owner

@dubzzz dubzzz commented Jul 19, 2023

The current implementation of ulid was relying on many unneeded intermediate arrays to construct and deconstruct ulids. We just make it faster by relying on less intermediate arrays.

The change should reduce the memory footprint of ulids.

More to come with a partial revamp of some parts of the logic.

Category:

  • ✨ Introduce new features
  • 📝 Add or update documentation
  • ✅ Add or update tests
  • 🐛 Fix a bug
  • 🏷️ Add or update types
  • ⚡️ Improve performance
  • Other(s): ...

Potential impacts:

  • Generated values
  • Shrink values
  • Performance
  • Typings
  • Other(s): ...

Sorry, something went wrong.

dubzzz added 2 commits July 19, 2023 07:04
The current implementation of `ulid` was relying on many unneeded intermediate arrays to construct and deconstruct ulids. We just make it faster by relying on less intermediate arrays.

The change should reduce the memory footprint of ulids.

More to come with a partial revamp of some parts of the logic.
@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit a80a455:

Sandbox Source
Vanilla Configuration
@fast-check/examples Configuration

@dubzzz dubzzz enabled auto-merge (squash) July 19, 2023 07:13
@codecov
Copy link

codecov bot commented Jul 19, 2023

Codecov Report

Merging #4088 (a80a455) into main (b2ebe9c) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #4088   +/-   ##
=======================================
  Coverage   94.64%   94.64%           
=======================================
  Files         211      211           
  Lines        5898     5905    +7     
  Branches     1353     1351    -2     
=======================================
+ Hits         5582     5589    +7     
  Misses        300      300           
  Partials       16       16           
Flag Coverage Δ
unit-tests 94.64% <100.00%> (+<0.01%) ⬆️
unit-tests-14.x-Linux 94.59% <100.00%> (-0.05%) ⬇️
unit-tests-16.x-Linux 94.64% <100.00%> (+<0.01%) ⬆️
unit-tests-18.x-Linux ?
unit-tests-latest-Linux ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...arbitrary/_internals/mappers/UintToBase32String.ts 94.11% <100.00%> (+1.01%) ⬆️
packages/fast-check/src/arbitrary/ulid.ts 93.75% <100.00%> (+0.89%) ⬆️

@dubzzz dubzzz merged commit 1307c3b into main Jul 19, 2023
@dubzzz dubzzz deleted the drop-unneeded-mem-alloc branch July 19, 2023 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant