Bug 18673 - Quadratic Time for Enumerable.GroupBy
Summary: Quadratic Time for Enumerable.GroupBy
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Core ()
Version: master
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2014-03-31 14:18 UTC by Aggelos Biboudis
Modified: 2014-04-30 05:55 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Aggelos Biboudis 2014-03-31 14:18:52 UTC
This snippet seems to run in quadratic time (forever). 

Enumerable.Range(1,10000000).GroupBy(x => x).ToArray();

This doesn't happen in the parallel version.
Comment 1 Aggelos Biboudis 2014-04-01 16:52:54 UTC
This seems to be the problem. The nested iterations in https://github.com/mono/mono/blob/master/mcs/class/System.Core/System.Linq/Enumerable.cs#L916
Comment 2 Marek Safar 2014-04-30 05:55:26 UTC
Fixed in master