T
TWischmeier
Greetings,
we recently switched our target framework for our mobile application
to .netcf 3.0. This opened up the possibility of using lambda
expressions. I asked google about the performance impact of using
lambdas, but I could not find a suitable answer. I am talking about
the language construct itself, not about the difference between linq
and SqlCe-Queries, to be clear. A quick example, to disable all
Buttons in a Sequence:
Without lambdas:
IEnumerator<Button> btnEnum = buttons.GetEnumerator();
while(btnEnum.MoveNext()) {
btnEnum.Current.Disable;
btnEnum.Current.Visible = false;
}
With lambdas:
buttons.Select<Button>( b => {
b.Disable;
b.Visible = false;
});
How would those two codesnippets compare in regards to memory usage,
runtime, etc?
Best Regards,
Tim
we recently switched our target framework for our mobile application
to .netcf 3.0. This opened up the possibility of using lambda
expressions. I asked google about the performance impact of using
lambdas, but I could not find a suitable answer. I am talking about
the language construct itself, not about the difference between linq
and SqlCe-Queries, to be clear. A quick example, to disable all
Buttons in a Sequence:
Without lambdas:
IEnumerator<Button> btnEnum = buttons.GetEnumerator();
while(btnEnum.MoveNext()) {
btnEnum.Current.Disable;
btnEnum.Current.Visible = false;
}
With lambdas:
buttons.Select<Button>( b => {
b.Disable;
b.Visible = false;
});
How would those two codesnippets compare in regards to memory usage,
runtime, etc?
Best Regards,
Tim