foreach ( Effect effect in this.Effects.Where ( e => e.IsTransparentEffect && e.HasGPUSupport ) )
yield return new RealtimeEffect<TransparentEffect> ( effect );
vs
this.Effects.Where ( e => e.IsTransparentEffect && e.HasGPUSupport )
.Select ( e => new RealtimeEffect<TransparentEffect> ( e ) );
I somehow think the Select would try to gather the results differently than just yielding it like in #1?
Also would there be any performance difference?
Both codes will return the same results. Both have deferred execution (i.e. nothing will actually be executed until you start enumerating the result) and stream the results (i.e. not buffered). There shouldn’t be a significant performance difference between the two versions