radashi-org / radashi

The modern, community-first TypeScript toolkit with all of the fast, readable, and minimal utility functions you need. Type-safe, dependency-free, tree-shakeable, fully tested.
https://radashi.js.org
MIT License
315 stars 25 forks source link

chore: comparative benchmarks with lodash #258

Open MarlonPassos-git opened 2 months ago

MarlonPassos-git commented 2 months ago

[!TIP] The owner of this PR can publish a preview release by commenting /publish in this PR. Afterwards, anyone can try it out by running pnpm add radashi@pr<PR_NUMBER>.

Summary ()

While I'm working i am adding some notes to my fork of this lodash_parity.md

I changed the structure recommended by @aleclarson a bit because I ended up preferring to group the describers by {function} {variant}, as it allows me to have an easier visualization in the stdout of which library is faster in each function and case. In the future, I think it would be interesting to generate a .md file with this result.

image

bench removed

There are some bethmarks that exist for Radash but they are not able to have backward compatibility with Lodash. They ended up throwing errors during execution.

Problem to run multiples benchs

When i try run more then 10 benchs alwares the bench fail with some memory leak error,

image

when i change the pool option to threads when we run the benchmark. It improve a litle, but still keeps throwing memory errors

    pool: env.mode === 'benchmark' ? 'threads' : 'forks',

I see some related issues However, the PR they made to vitest has not been uploaded to NPM so I will be testing it when it is available.

I will continue adding the other missing bench cases, but until this memory problem is resolved, we will not be able to approve it.

Related issue, if any:

For any code change,

Does this PR introduce a breaking change?

No

socket-security[bot] commented 1 week ago

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@types/lodash@4.17.9 None 0 867 kB types
npm/lodash@4.17.21 None 0 1.41 MB bnjmnt4n
npm/tsx@4.19.2 Transitive: filesystem +2 547 kB hirokiosame

View full report↗︎