NuGet / NuGetGallery

NuGet Gallery is a package repository that powers https://www.nuget.org. Use this repo for reporting NuGet.org issues.
https://www.nuget.org/
Apache License 2.0
1.52k stars 643 forks source link

use Count instead of Where+Count #10016

Closed SimonCropp closed 6 days ago

SimonCropp commented 2 weeks ago

Shorten Linq syntax by using just Count instead of Where+Count.

erdembayar commented 1 week ago

LGTM, it's technically just a cosmetic syntax change, shouldn't change actual behavior.

SimonCropp commented 1 week ago

technically just a cosmetic syntax change

nope. this halves the number of linq evaluation. so has memory, cpu, assembly size, build time, and jit time improvements. Admittedly some of thee would be difficult to measure. but the memory + cpu would impact a fast path

erdembayar commented 1 week ago

technically just a cosmetic syntax change

nope. this halves the number of linq evaluation. so has memory, cpu, assembly size, build time, and jit time improvements. Admittedly some of thee would be difficult to measure. but the memory + cpu would impact a fast path

Thank you for the clarification. I haven't done any performance-related work recently, my memory is vague. Also, I noticed that performance numbers vary for tfm. Unfortunately, we're still using net472.

SimonCropp commented 6 days ago

Unfortunately, we're still using net472.

it will still result in perf improvements on net472