Repository navigation
[osx] Cache the IsOSX check - #2863
Conversation
There was a problem hiding this comment.
Wouldn't it be better to make a Lazy<bool> which calls this?
There was a problem hiding this comment.
I suppose a pinvoke is faster than IO, and lazy will also prevent multiple evaluation.
There was a problem hiding this comment.
I just wanted a minimal patch which can be easily/safely backported to release branches. If we want a more invasive patch it might be frowned on when we go to backport it
There was a problem hiding this comment.
(also, multiple execution is not something that we need to be particularly worried about in this case, so i left it as a simple nullable bool)
There was a problem hiding this comment.
Yeah, accidentally hitting the filesystem cache twice or three times in an unlucky build seems like a fine tradeoff for the contained, straightforward implementation here.
rainersigwald
left a comment
There was a problem hiding this comment.
LGTM modulo bracing nit. Thanks!
There was a problem hiding this comment.
Yeah, accidentally hitting the filesystem cache twice or three times in an unlucky build seems like a fine tradeoff for the contained, straightforward implementation here.
There was a problem hiding this comment.
Our style would prefer braces around this line.
AndyGerlicher
left a comment
There was a problem hiding this comment.
Looks good to me (once the { } are added around the if per @rainersigwald. Thanks for the contribution!
This ensure we won't hit the filesystem a few million times during project evaluation. Fixes mono/mono#6530
|
Braces have been fixed! Thanks |
|
Thanks! |
This ensures we won't hit the filesystem a few million times during project evaluation. Fixes mono/mono#6530. (cherry picked from commit a80ce1f)
This ensures we won't hit the filesystem a few million times during project evaluation. Fixes mono/mono#6530. (cherry picked from commit a80ce1f)
|
It's not thread safe but the only impact of that would be us hitting the filesystem a handful of times instead of just once. Either way we've reduced literally millions of filesystem hits to a tiny bounded number of invocations, typically just 1. |
This ensure we won't hit the filesystem a few million times
during project evaluation.
Fixes mono/mono#6530