Open ngeiswei opened 4 months ago
@ngeiswei , one strange thing I see is that Python in this case 6x times slower than Rust REPL. For instance running example through the Rust Repl gives:
time cargo run --release --features minimal,no_python /tmp/638.metta
[10]
real 0m8.188s
user 0m8.145s
sys 0m0.040s
It is the first issue I would like to investigate.
I would recommend using Rust REPL if it is possible in your case.
What is your problem?
In minimal MeTTa
cdr-atom
is very slow.How to reproduce your problem?
Compile MeTTa with "minimal" feature.
Run the following program
What would you normally expect?
instantly.
What do you get instead?
in 38s on my Ryzen 7 2700X.
What else do you have to say?
I suspect the problem comes from
cdr-atom
, so I wrote an equivalent program that does not rely oncdr-atom
, see belowit takes 4s.
Also, I compared
gen-list
andgen-tuple
only and they are about as fast, consolidating the idea thatcdr-atom
is the culprit.In non-minimal MeTTa it takes 1s for tuple and 0.5s for list, which is obviously much better, though still slow.