grahamboree,
@grahamboree@mastodon.gamedev.place avatar

I just replaced nine Linq function calls with equivalent simple loops and cut the runtime of an asset processing tool from 2m40s to 1m5s.

That's 95 seconds of nothing but Linq overhead.

The code does the exact same work in the exact same way, the only difference is whether it uses Linq or not.

The most expensive call by far was "ToArray()", taking nearly 75% of the profile time.

That's beyond insane. If this doesn't make you scared of Linq, I don't know what will.

AngryAnt,
@AngryAnt@mastodon.gamedev.place avatar

@grahamboree Not super surprised that ToArray would be the culprit here. It’s tangential to “threading is the worst performer - every time I take a lock it takes forever”.

Given the numbers you cite here, one could get the impression that going with the Linq version of the code, but getting rid of the ToArray call would be faster than the manual loop version.

AngryAnt,
@AngryAnt@mastodon.gamedev.place avatar

@grahamboree Sorry, TLDR; “nope that certainly doesn’t scare me” ;)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • programming
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines