Replies: 2 comments 3 replies
-
Interesting. I am going to try to reap some examples from there, and build more benchmarks.
These packages are good to discover symbols with are not implemented. I have to look at it again at some point. But OK, at least now it fails faster...
If we want to check that the head of an expression is
Apart from the problem with that approach is that it adds a tiny overhead to each expression, which is a very frequent operation, this would break the modularity we gain with the last changes. I think that is good to be able to deal with different representations of expressions of the form Then, I guess that the right place to ensure the conversion is in the specific places where the expressions are created. On the other hand, there are cases where |
Beta Was this translation helpful? Give feedback.
-
I didn't explain this well.
|
Beta Was this translation helpful? Give feedback.
-
Yesterday, @mmatera (almost) finished of basically the first round or cut at sorting Expression versus ListExpression constructor calls.
I have been experimenting with the code to try to understand what this gives us and what remains. There is alas still a lot just in Expression/ListExpression untangling but right now it still would be good to pause and take stock.
With this we could start doing benchmark testing. Here, I'd like others to get involved. The results may also be less biased too.
General Performance Questions
But there are also some generic benchmark questions I have like:
Benchmark sources
Finding a good benchmark suite of a normal Mathematica load that we can focus on. Some sources I see are:
On the positive side, code that was too slow to load before like Rubi and KnotTheory now loads in a reasonable amount of time.
On the negative side, neither of these come any closer to working.
Removing Extraneous Conversions
In this branch I have code that has removed the conversions should you want to try using that. (Sorry about the typo in the branch name).
What I have been using to compare this against is 4.0.0-benchmark. This is basically the 4.0.0 code with one additional benchmark file that I use for testing against. In that branch you'll see a file with some timings I have been periodically doing to make sure we are going in the right direction
I will look into having a way in one branch where at startup time we can have a fully instrumented checking on List/Expression creation (even more so than we do now) but in the normal case use the fast expression evaluation.
Follow ons
I looked at whether we can now use the simpler and faster
isinstance(x, ListExpression)
instead of the more general and slowerx.has_form("List", None)
which comes up quite a bit.Nope.
Basically the reason not is that there are lots of Expression() calls inside the evaluation of some expression like this:
which will convert ListExpression into Expression. A simple remedy here is to do a lookup by head name on the expression constructor which would return Expression or ListExpression or something else as appropriate.
Beta Was this translation helpful? Give feedback.
All reactions