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

chore: comparative benchmarks with lodash #258

Draft
wants to merge 75 commits into
base: main
Choose a base branch
from

Conversation

MarlonPassos-git
Copy link
Contributor

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 ()

  • Create the comparisons folder, and make comparatives benchmarks with lodash
  • Change the bench script

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.

  • isPlainObject
    • with non-plain object (Date)
    • with namespace object
    • with non-plain object (arguments)
    • with null

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,

  • Related documentation has been updated, if needed
  • Related tests have been added or updated, if needed
  • Related benchmarks have been added or updated, if needed

Does this PR introduce a breaking change?

No

@MarlonPassos-git MarlonPassos-git added in progress Things being worked on maintenance An improvement to codebase maintainability labels Sep 28, 2024
Copy link

socket-security bot commented Nov 23, 2024

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

Package New capabilities Transitives Size Publisher
npm/@types/[email protected] None 0 867 kB types
npm/[email protected] None 0 1.41 MB bnjmnt4n
npm/[email protected] Transitive: filesystem +2 547 kB hirokiosame

View full report↗︎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress Things being worked on maintenance An improvement to codebase maintainability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Comparative benchmarks
6 participants