|
![](/i/fill.gif) |
On Tue 04/12/12 19:09, Orchid Win7 v1 wrote:
>>> Not exactly taxing, eh?
>>
>> Of course there are many ways to approach this in C# and most other
>> languages. Using LINQ and and working in decimal datatype without error
>> handling:
>>
>> private List<decimal> ParseAndSortValuesFromString1(string text)
>> {
>> return text.Split(' ').Select(s => Decimal.Parse(s)).OrderBy(s =>
>> s).ToList();
>> }
>
> According to one of the guys I work with, "LINQ is great and everything,
> but it makes the code extremely slow". Does anybody have any actual
> /facts/ with which to confirm or refute this? I would have expected
> there to be a fairly minimal speed difference...
LINQ has a certain amount of overhead, as to whether that significantly
impacts the speed of your code obviously depends on the exact code and
data you're dealing with. Even in your example I suspect the speed
differential is highly dependent on the size of the list.
Post a reply to this message
|
![](/i/fill.gif) |