Roger-luo / Moshi.jl

nextgen MLStyle: Generic Algebraic Data Type + Pattern Match
http://rogerluo.dev/Moshi.jl/
MIT License
57 stars 1 forks source link

Speedup DynamicSumTypes benchmark #6

Closed Tortar closed 1 month ago

Tortar commented 1 month ago

This is on pair with the base version on my pc. It uses the same structs as the one in the base.jl file making the comparison more correct.

Tortar commented 1 month ago

But I understand that this was actually copy-pasted from the ReadMe of DynamicSumTypes, indeed in a previous version the other formulation was better for DynamicSumTypes, but it developed so that it is better this formulation :-)

Roger-luo commented 1 month ago

Oh yeah, I just realized there is a difference between DynamicSumTypes README example and others. DynamicSumTypes now only has a small difference compared to match and baseline on v1.11.

image

but on v1.10 it is still way slower

image

This is interesting. I didn't expect there to be a big difference. I would expect Complex{Float64} to perform better (others are using Complex{Real}.

Roger-luo commented 1 month ago

I've updated a few other things together in #7 the benchmark should now be updated on website. Thanks for the correction!