Skip to content

Strange Performance issue after upgrading from 1.6.0.2 to 1.6.2 #921

Description

@pinchojasp

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
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions