Code Monkey home page Code Monkey logo

Comments (5)

FrancescAlted avatar FrancescAlted commented on May 30, 2024

From [email protected] on January 24, 2011 00:24:14

Okay. I'll have a look at your patch. Could you please send a small benchmark showing the speed-ups of your approach?

Thanks!

from numexpr.

FrancescAlted avatar FrancescAlted commented on May 30, 2024

From [email protected] on January 24, 2011 01:55:45

Here is a modified version of bench/varying-expr.py which shows a nice speedup:
on my machine it goes from 17.596 seconds to 10.799 seconds with the patch.

Of note is that the unmodified varying-expr.py does not show any improvement. I guess that expression is too simple to trigger the repetitive hash calls.

Again, this is probably more of a proof of concept than a real patch, because it suppose ASTNode is read-only (which seem to be the case) but is not enforced anywhere and it would cause very weird errors if the nodes are ever modified.

Attachment: latency.py

from numexpr.

FrancescAlted avatar FrancescAlted commented on May 30, 2024

From [email protected] on January 24, 2011 08:39:38

As I feared, the ASTNode were not really read-only. They are at least modified in collapseDuplicateSubtrees. I don't think that caching patch introduced any problem anyway because of the way the hash is used there, but it's too risky.

FWIW, the other patch yields "14.38 seconds" to the "latency.py" test.

from numexpr.

FrancescAlted avatar FrancescAlted commented on May 30, 2024

From [email protected] on January 25, 2011 04:42:36

I'm not familiar with that part of the code, so let's walk on the safe side. So will apply the first patch (done in #273).

Anyway, if in the future you can demonstrate that the second patch is safe for any practical use, I'll be glad to get it in.

Status: Verified

from numexpr.

FrancescAlted avatar FrancescAlted commented on May 30, 2024

From [email protected] on January 25, 2011 05:07:45

Well, this seems risky stuff and doing it in a way that is both correct and faster would probably take more time than I'm willing to invest for such minor gains.

from numexpr.

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.