Comments (5)
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.
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.
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.
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.
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)
- ValueError exception for scientific notation with digits after . HOT 2
- It is not possible to disable sanitization via `NUMEXP_SANITIZE` when using `numexpr.NumExpr` HOT 2
- pow with integer arrays that overflow differs from numpy in 2.8.7 HOT 5
- Please upload a pure python wheel to PyPi HOT 2
- ``global_dict`` input ignored in version 2.8.7 HOT 5
- support new numpy complex types HOT 5
- Forbidden Control Character Error for imaginary element HOT 1
- `NPY_MAXARGS` not a compile time constant HOT 3
- Test failures on PyPy3.10: mostly `ValueError: ex_uses_vml parameter is required` HOT 28
- numexpr.test() not working on Mac M1, python 3.9, numpy 2.0.0.dev HOT 2
- [BUG]: Sanitizing regex does not exclude string literals HOT 3
- 2.9.0 tar.gz is missing on pypi HOT 2
- Numexpr engine in pandas fails when using eval on a dataframe HOT 1
- Stale Issues HOT 6
- Copy transpose operation HOT 1
- Tests fail on 12-thread Ryzen 5 HOT 5
- Complex (imaginary) evaluations HOT 7
- Citation preferences
- Is it possible to programatically invert a `numexpr`? HOT 1
- pandas testsuite with numpy 2.0.0rc1 fails on numexpr HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from numexpr.