Giter Club home page Giter Club logo

Comments (5)

anywhichway avatar anywhichway commented on August 27, 2024

from nano-memoize.

ThomasF85 avatar ThomasF85 commented on August 27, 2024

I am happy to help :)
I just figured out that the test I wrote is flawed too, since lodash does not memoize functions with multiple arguments correctly out of the box, but just uses the first argument for a key. That might be the case for some more of these libs I put into the test. So it's not really a realistic test afterall and I guess it takes some time to get into the details and get everything figured out.

from nano-memoize.

anywhichway avatar anywhichway commented on August 27, 2024

from nano-memoize.

ThomasF85 avatar ThomasF85 commented on August 27, 2024

I recommend creating a few different benchmarking fixtures / scenarios.
Some for a function with a single primitive parameter, some for a function with a few primitive parameters and some for non primitive parameters.
It’s probably best and most realistic when you test for these functions to be called with a set of a few hundred or thousand different arguments repeatedly. That would simulate the memoized function being called with a lot of different arguments, but also with a lot of repeating arguments so the memoization kicks in.
I think that’s basically what you are already doing except for having a set of a lot of different arguments. From what I saw you test for one and the same argument being passed to the memoized function or for just a handful of different arguments - instead of a few hundred or thousand.

from nano-memoize.

anywhichway avatar anywhichway commented on August 27, 2024

Fixed. Thanks for your input.

from nano-memoize.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.