Eben60 / Mendeleev.jl

A Julia package for accessing chemical elements data.
https://eben60.github.io/Mendeleev.jl/
Other
19 stars 0 forks source link

Vector instead of Dict performance #5

Open chakravala opened 1 year ago

chakravala commented 1 year ago

if you're using sequential integers as keys, you might as well use a Vector with sequential integer indices, as that has faster

https://github.com/Eben60/Mendeleev.jl/blob/main/src/data.jl/ionization_data.jl

Eben60 commented 1 year ago

chakravala, thank you for looking onto my source code - I know you are a highly competent Julia developer.

I must however say, I didn't at all try to optimize the package for the speed, not even tested. Actually I can't imagine any use case where the speed can be relevant.

So while in principle you are right, I'd in the moment leave it as it is. I'd also leave the issue open, but as low priority for the code refactoring some day.