Stop warp only if there are runnable expierments#16
Stop warp only if there are runnable expierments#16canisin wants to merge 2 commits intothewebbooth:masterfrom
Conversation
X-Science/StatusWindow.cs
Outdated
| if( _filter.TotalCount > 0 ) | ||
| { | ||
| if( _filter.TotalCount - _filter.CompleteCount > 0 ) | ||
| if( _filter.DisplayScienceInstances.Any(x => CanRunExperiment(x)) ) |
There was a problem hiding this comment.
Can we find a non-LINQ way to do this test? LINQ is great for code readability, but it creates a lot of temporary objects that have to be garbage collected, and that's not good for consistent game performance.
There was a problem hiding this comment.
well, any linq can be converted to a basic loop more or less easily. but i am not sure if it would save us much in terms of performance. premature optimization is the root of all evil and all that :) but let me try and create a new pull request that gets rid of the linq and then you can decide to adopt either.
There was a problem hiding this comment.
I have created a new commit that replaces linq with a regular loop. I could not create a pull request this time. I just don't really know how it works. I hope the new commit is visible to you. If not, contact me on the forums.
|
"without linq" - good, but in general you want to avoid "foreach" as well if you're already going to this level of optimization, unless you know for sure that the foreach won't generate garbage. |
As per discussion on the forums.