-
-
Notifications
You must be signed in to change notification settings - Fork 237
Closed
Labels
Description
Hi there,
I have a strange performance issue after upgrading to last version, using .NET Framework 4.8.
In the previous version, the second query takes 47 ms and now it takes more than 50 seconds.
Regards
class Demo
{
public int ID { get; set; }
public string Name { get; set; }
public string Description { get; set; }
}static void Main(string[] args)
{
TestDynamic();
}private static void TestDynamic()
{
List<Demo> list = new List<Demo>();
for (int i = 0; i < 100000; i++)
{
list.Add(new Demo { ID = i, Name = $"Name {i}", Description = $"Description {i}" });
}
var xTimeAll = System.Diagnostics.Stopwatch.StartNew();
var query = list.AsQueryable().Select(typeof(Demo),"new { ID, Name }").AsEnumerable().ToList();
Console.WriteLine($"Total First Query: {(int)xTimeAll.Elapsed.TotalMilliseconds}ms");
/// Using Version 1.6.0.2 : Total First Query: 254ms
/// Using Version 1.6.2.0 : Total First Query: 195ms
xTimeAll.Restart();
var results = query.AsQueryable().Select("ID").Cast<int>().ToList();
Console.WriteLine($"Total Second Query: {(int)xTimeAll.Elapsed.TotalMilliseconds}ms");
// Using Version 1.6.0.2 : Total Second Query: 47ms
// Using Version 1.6.2.0 : Total Second Query: 54116ms
}StefH