public bool Equals(IJob other) { var ownProperties = this.GetAllProperties().ToArray(); var otherProperties = other.GetAllProperties().ToArray(); if (ownProperties.Length != otherProperties.Length) return false; int n = ownProperties.Length; return Enumerable.Range(0, n).All(i => ownProperties[i].Key == otherProperties[i].Key && ownProperties[i].Value == otherProperties[i].Value); }
public bool Equals(IJob other) { var ownProperties = this.GetAllProperties().ToArray(); var otherProperties = other.GetAllProperties().ToArray(); if (ownProperties.Length != otherProperties.Length) { return(false); } int n = ownProperties.Length; return(Enumerable.Range(0, n).All(i => ownProperties[i].Key == otherProperties[i].Key && ownProperties[i].Value == otherProperties[i].Value)); }
public static string GetShortInfo(this IJob job) { // TODO: make it automatically string shortInfo; if (TryGetShortInfo(job, out shortInfo)) { return(shortInfo); } var defaultJobProperties = Job.Default.GetAllProperties().ToArray(); var ownProperties = job.GetAllProperties().ToArray(); var n = ownProperties.Length; var targetProperties = Enumerable.Range(0, n). Where(i => ownProperties[i].Value != defaultJobProperties[i].Value). Select(i => ownProperties[i]); return(string.Join("_", targetProperties.Select(GetShortInfoForProperty))); }
public static string GetShortInfo(this IJob job, IList <IJob> allJobs) { // TODO: make it automatically if (job.Equals(Job.LegacyJitX86)) { return("LegacyX86"); } if (job.Equals(Job.LegacyJitX64)) { return("LegacyX64"); } if (job.Equals(Job.RyuJitX64)) { return("RyuJitX64"); } if (job.Equals(Job.Dry)) { return("Dry"); } if (job.Equals(Job.Mono)) { return("Mono"); } if (job.Equals(Job.Clr)) { return("Clr"); } var defaultJobProperties = Job.Default.GetAllProperties().ToArray(); var ownProperties = job.GetAllProperties().ToArray(); var n = ownProperties.Length; var targetProperties = Enumerable.Range(0, n). Where(i => ownProperties[i].Value != defaultJobProperties[i].Value && allJobs.Select(j => j.GetAllProperties().ToArray()[i].Value).Distinct().Count() > 1). Select(i => ownProperties[i]); return(string.Join("_", targetProperties.Select(GetShortInfoForProperty))); }
public static string GetFullInfo(this IJob job) => string.Join("_", job.GetAllProperties().Select(p => $"{p.Key}-{p.Value}"));