AdamsLair / duality

a 2D Game Development Framework
https://adamslair.github.io/duality
MIT License
1.4k stars 291 forks source link

Improved RawList API, Implementation and Tests #830

Closed ilexp closed 4 years ago

ilexp commented 4 years ago

As noted in #820, the RawList<T> class can benefit from newly available ref-returns in C# 7.3 for its indexer implementation. Since this is a breaking change for v4.0, it also was a good opportunity to rework and extend some of its API to better address its core use case.

This PR adds several small improvements, as well as a by-ref indexer for RawList<T>. For a detailed list, see the individual commits, which have been structured so each one represents a group of changes.

Barsonax commented 4 years ago

For the performance improvements did you do any testing (benchmarkdotnet?)? Pretty sure this improves the performance but its always good to verify and also know how much it improves it.

ilexp commented 4 years ago

Addressed the change request you made, see above.

For the performance improvements did you do any testing (benchmarkdotnet?)? Pretty sure this improves the performance but its always good to verify and also know how much it improves it.

You're right, but no, I didn't run any benchmarks. Mostly for time reasons and given the very small scope of the two tweaks, I stopped at "pretty sure it's an improvement".

Barsonax commented 4 years ago

Addressed the change request you made, see above.

For the performance improvements did you do any testing (benchmarkdotnet?)? Pretty sure this improves the performance but its always good to verify and also know how much it improves it.

You're right, but no, I didn't run any benchmarks. Mostly for time reasons and given the very small scope of the two tweaks, I stopped at "pretty sure it's an improvement".

Ok well as the changes are pretty small and seem to make sense iam assuming it will be ok :)