rsdn / CodeJam

Set of handy reusable .NET components that can simplify your daily work and save your time when you copy and paste your favorite helper methods and classes from one project to another
MIT License
258 stars 35 forks source link

Use array instead of `yield return`. #107

Closed NN--- closed 4 years ago

NN--- commented 4 years ago

Fix #106

andrewvk commented 4 years ago

It is worth using conditional compilation and leaving the old code for .net fw.

ig-sinicyn commented 4 years ago

I'd check memory allocations for both versions. If there's no large impact, I'd prefer to keep a single solution (the one with array).

NN--- commented 4 years ago

Given the amount of generated code I don't know whether array is less memory efficient.

ig-sinicyn commented 4 years ago

We can check impact with help of the BDN's MemoryDiagnoser :)

ig-sinicyn commented 4 years ago

As far as I can see from the code, amount of allocations should be nearly identical for both versions.