Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

And linq #895

Merged
merged 4 commits into from
Sep 30, 2024
Merged

And linq #895

merged 4 commits into from
Sep 30, 2024

Commits on Sep 28, 2024

  1. Proposed clean-ups

    This is a partial set of clean-ups. There could be others, but they may be controversial (e.g. adopting LINQ in some areas, which may or may not hurt performance). I've also tried to be mindful of target framework versions and also some edge cases (e.g. hashing) where seemingly redundant chunks of code, if removed or changed for another option, may blow things up.
    
    See what you think.
    philstopford committed Sep 28, 2024
    Configuration menu
    Copy the full SHA
    2b2effd View commit details
    Browse the repository at this point in the history
  2. Adding LINQ on top of the other clean-ups

    Pre-change:
    
    // * Summary *
    
    BenchmarkDotNet=v0.12.1, OS=endeavouros
    AMD Ryzen 7 5800H with Radeon Graphics, 1 CPU, 16 logical and 8 physical cores
    .NET Core SDK=8.0.108
      [Host]     : .NET Core 8.0.8 (CoreCLR 8.0.824.36612, CoreFX 8.0.824.36612), X64 RyuJIT
      Job-GRIUMJ : .NET Core 8.0.8 (CoreCLR 8.0.824.36612, CoreFX 8.0.824.36612), X64 RyuJIT
    
    IterationCount=1  LaunchCount=1  WarmupCount=1
    
    |         Method | EdgeCount |       Mean | Error |     Gen 0 |     Gen 1 |     Gen 2 | Allocated |
    |--------------- |---------- |-----------:|------:|----------:|----------:|----------:|----------:|
    | Intersection_N |      1000 |   119.9 ms |    NA | 1000.0000 |         - |         - |   9.04 MB |
    | Intersection_N |      2000 |   542.1 ms |    NA | 1000.0000 |         - |         - |   16.2 MB |
    | Intersection_N |      3000 | 1,431.1 ms |    NA | 5000.0000 | 4000.0000 | 1000.0000 |  37.28 MB |
    | Intersection_N |      4000 | 3,008.9 ms |    NA | 6000.0000 | 5000.0000 | 1000.0000 |  47.41 MB |
    | Intersection_N |      5000 | 6,173.7 ms |    NA | 9000.0000 | 8000.0000 | 1000.0000 |  74.05 MB |
    
    // * Legends *
      EdgeCount : Value of the 'EdgeCount' parameter
      Mean      : Arithmetic mean of all measurements
      Error     : Half of 99.9% confidence interval
      Gen 0     : GC Generation 0 collects per 1000 operations
      Gen 1     : GC Generation 1 collects per 1000 operations
      Gen 2     : GC Generation 2 collects per 1000 operations
      Allocated : Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)
      1 ms      : 1 Millisecond (0.001 sec)
    
    // * Diagnostic Output - MemoryDiagnoser *
    
    // ***** BenchmarkRunner: End *****
    // ** Remained 0 benchmark(s) to run **
    Run time: 00:00:47 (47.83 sec), executed benchmarks: 5
    
    Global total time: 00:00:57 (57.28 sec), executed benchmarks: 5
    
    Post-change:
    
    // * Summary *
    
    BenchmarkDotNet=v0.12.1, OS=endeavouros
    AMD Ryzen 7 5800H with Radeon Graphics, 1 CPU, 16 logical and 8 physical cores
    .NET Core SDK=8.0.108
      [Host]     : .NET Core 8.0.8 (CoreCLR 8.0.824.36612, CoreFX 8.0.824.36612), X64 RyuJIT
      Job-WWTCPL : .NET Core 8.0.8 (CoreCLR 8.0.824.36612, CoreFX 8.0.824.36612), X64 RyuJIT
    
    IterationCount=1  LaunchCount=1  WarmupCount=1
    
    |         Method | EdgeCount |       Mean | Error |     Gen 0 |     Gen 1 |     Gen 2 | Allocated |
    |--------------- |---------- |-----------:|------:|----------:|----------:|----------:|----------:|
    | Intersection_N |      1000 |   127.1 ms |    NA |         - |         - |         - |   6.85 MB |
    | Intersection_N |      2000 |   475.1 ms |    NA | 2000.0000 | 1000.0000 |         - |  23.04 MB |
    | Intersection_N |      3000 | 1,408.1 ms |    NA | 5000.0000 | 4000.0000 | 1000.0000 |  36.15 MB |
    | Intersection_N |      4000 | 2,874.6 ms |    NA | 5000.0000 | 4000.0000 | 1000.0000 |  41.76 MB |
    | Intersection_N |      5000 | 5,954.3 ms |    NA | 9000.0000 | 8000.0000 | 2000.0000 |  68.62 MB |
    
    // * Legends *
      EdgeCount : Value of the 'EdgeCount' parameter
      Mean      : Arithmetic mean of all measurements
      Error     : Half of 99.9% confidence interval
      Gen 0     : GC Generation 0 collects per 1000 operations
      Gen 1     : GC Generation 1 collects per 1000 operations
      Gen 2     : GC Generation 2 collects per 1000 operations
      Allocated : Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)
      1 ms      : 1 Millisecond (0.001 sec)
    
    // * Diagnostic Output - MemoryDiagnoser *
    
    // ***** BenchmarkRunner: End *****
    // ** Remained 0 benchmark(s) to run **
    Run time: 00:00:46 (46.34 sec), executed benchmarks: 5
    
    Global total time: 00:00:51 (51.28 sec), executed benchmarks: 5
    philstopford committed Sep 28, 2024
    Configuration menu
    Copy the full SHA
    9c18c1b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    20d2f9c View commit details
    Browse the repository at this point in the history

Commits on Sep 30, 2024

  1. Configuration menu
    Copy the full SHA
    63251ea View commit details
    Browse the repository at this point in the history