Skip to content

feat: Add JobOrderPolicy option to sort jobs by numeric order #2770

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

Merged

Conversation

filzrev
Copy link
Contributor

@filzrev filzrev commented Jun 12, 2025

This PR intended to fix issue #2768.

What's changed in this PR

  1. Add JobOrderPolicy that similar to SummaryOrderPolicy/MethodOrderPolicy
  2. Modify DefaultOrderer/JobComparer/OrdererAttribute to accept JobOrderPolicy parameter.
  3. Add NumericStringComparer nested class to JobComparer. this class compare string with numeric ordering.
  4. Add unit tests to JobOrderTests.cs

Note: This PR don't change existing behaviors. Numeric job ordering feature is enabled when explicitly enabled.

List of Job characteristics
Job characteristics is compared by following priorities.

foreach (var characteristic in x.GetAllCharacteristics())
{
if (!x.HasValue(characteristic))
{
if (y.HasValue(characteristic))
return -1;
continue;
}
if (!y.HasValue(characteristic))
{
if (x.HasValue(characteristic))
return 1;
continue;
}
int compare = string.CompareOrdinal(
presenter.ToPresentation(x, characteristic),
presenter.ToPresentation(y, characteristic));
if (compare != 0)
return compare;
}

  [0]: {Id}
  [1]: {Accuracy}
  [2]: {AnalyzeLaunchVariance}
  [3]: {EvaluateOverhead}
  [4]: {MaxAbsoluteError}
  [5]: {MaxRelativeError}
  [6]: {MinInvokeCount}
  [7]: {MinIterationTime}
  [8]: {OutlierMode}
  [9]: {Environment}
  [10]: {Affinity}
  [11]: {EnvironmentVariables}
  [12]: {Jit}
  [13]: {LargeAddressAware}
  [14]: {Platform}
  [15]: {PowerPlanMode}
  [16]: {Runtime}
  [17]: {Gc}
  [18]: {AllowVeryLargeObjects}
  [19]: {Concurrent}
  [20]: {CpuGroups}
  [21]: {Force}
  [22]: {HeapAffinitizeMask}
  [23]: {HeapCount}
  [24]: {NoAffinitize}
  [25]: {RetainVm}
  [26]: {Server}
  [27]: {Infrastructure}
  [28]: {Arguments}
  [29]: {BuildConfiguration}
  [30]: {Clock}
  [31]: {EngineFactory}
  [32]: {NuGetReferences}
  [33]: {Toolchain}
  [34]: {Meta}
  [35]: {Baseline}
  [36]: {IsDefault}
  [37]: {IsMutator}
  [38]: {Run}
  [39]: {InvocationCount}
  [40]: {IterationCount}
  [41]: {IterationTime}
  [42]: {LaunchCount}
  [43]: {MaxIterationCount}
  [44]: {MaxWarmupIterationCount}
  [45]: {MemoryRandomization}
  [46]: {MinIterationCount}
  [47]: {MinWarmupIterationCount}
  [48]: {RunStrategy}
  [49]: {UnrollFactor}
  [50]: {WarmupCount}

@filzrev filzrev force-pushed the feat-add-options-sort-jobs-numericorder branch 2 times, most recently from 58bc8cd to a93bf0e Compare June 12, 2025 10:42
@filzrev filzrev force-pushed the feat-add-options-sort-jobs-numericorder branch from a93bf0e to fb0373b Compare June 12, 2025 11:25
Copy link
Collaborator

@timcassell timcassell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @filzrev!

@timcassell timcassell merged commit 6730bf1 into dotnet:master Jun 13, 2025
8 checks passed
@timcassell timcassell added this to the v0.15.2 milestone Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Add custom option to sort benchmark jobs by numeric orders
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy