Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Ah yes, the good old "I don't have to care about memory leaks, that's what the garbage collector is for"
-
Cache calculated property values in shadow properties (discard them on state change or make the class immutable). The beast will run just fine and fast. You don't even have to touch the calculations themselves.
-
@Oktokolo sad thing is a cache wouldn't help much as each property is only hit once or twice per run, but on many different instances of the objects.
-
@kwilliams "CalculatedSubscription360Costs". And there are many objects needing to calculate that. For object counts in the hundreds, some extra GC exercising normally doesn't matter much. So you probably speak about orders of magnitude more... I wonder what the application is actually supposed to do.
-
It's a fairly simple CRM, but since the properties are all nested (some properties call other properties using the same construction whxih then also call other properties) even a few hundred records can cause thousands of array allocations per cycle.
-
@kwilliams Jesus Christ! That sounds horribly built. Gonna need a whole cluster just to calculate.
Related Rants
Just found this absolute 5 head, galaxy brain implementation in a piece of code which is called in a loop by a background scheduler which has performance issues.
There are 20+ properties, some which are recursively calling other properties with the same implementation style in this class.
Constant out of memory errors have been reported for this software, I wonder why...
rant
big brain
c#