TudbuT / micro_ndarray

Very small multi-dimensional-array implementation
MIT License
1 stars 0 forks source link

Cache the stride #2

Closed Tnze closed 1 year ago

Tnze commented 1 year ago

It's better to cache the stride to make get faster.

This is a simple proof, which should be thoroughly reviewed and tested before being merged.

TudbuT commented 1 year ago

Looks good to me, will perform some tests and checks in a moment and merge if everything is good.

TudbuT commented 1 year ago

Suspicions confirmed: This writes out of bounds.

TudbuT commented 1 year ago

SmartSelect_20230510_180949_Flexcil This is confirmed by tests.

TudbuT commented 1 year ago

Good news is that this is really easily fixed by reversing the order of the assignments.

Tnze commented 1 year ago

Thank you, I fixed it. I also enabled Allow edits by maintainers so you can commit to my fork if necessary.

TudbuT commented 1 year ago

Alright, I'll add the new cache system to the unchecked methods this afternoon and then merge. You can do that as well if you have time, but no pressure :P

TudbuT commented 1 year ago

benchmarked, tested, works, yay!

it's not MUCH better performance, but good 'nuf.