aya-lang / aya

Pocket sized programs
MIT License
54 stars 3 forks source link

`ListImpl` for `double[]` #79

Closed nick-paul closed 1 year ago

nick-paul commented 1 year ago

Requires #78

Adds an optimized ListImpl for lists of doubles only. Math operations happen directly on the data in double[] and no longer need to use Number wrappers or NumberMath. The result is much faster vectorized operations.

Additionally, many of the algorithms (slice, rotate, ect.) have been optimized.

Still working on some proper benchmarks but here are some examples:

aya-0.3> 10000R:l; {{l 1+ 2- 3/ 4* 1.05^ ;} 10000 %}.time
5788 .# 5.8 seconds
aya-0.4> 10000R:l; {{l 1+ 2- 3/ 4* 1.05^ ;} 10000 %}.time
2186 .# 2.2 seconds
nick-paul commented 1 year ago

I don't plan any additional work here for the time being so I'll go ahead and merge this into v0.4-dev and split any remaining tasks off into other issues/branches