Skip to content

Improved comparison, equality, string parsing performance, and improved NuGet metadata#44

Merged
Seramis merged 5 commits into
ByteAether:mainfrom
Seramis:benchmark_overhaul
Jun 12, 2026
Merged

Improved comparison, equality, string parsing performance, and improved NuGet metadata#44
Seramis merged 5 commits into
ByteAether:mainfrom
Seramis:benchmark_overhaul

Conversation

@Seramis

@Seramis Seramis commented Jun 12, 2026

Copy link
Copy Markdown
Member

Description

Overhauled the benchmark suite to eliminate JIT dead-code elimination (no-ops) caused by static data reuse. Leveraging the corrected benchmarks, identified and implemented critical optimization paths for equality, comparison, and string parsing.

Changes

1. Benchmark Overhaul (Anti-JIT Optimization)

  • Problem: Previously, benchmarks operated on 1 or 2 static readonly instances, allowing the JIT compiler to optimize operations into no-ops.
  • Solution: Replaced static instances with a pre-allocated pool of 1024 distinct ULID pairs. Benchmark iterations now loop through this dataset sequentially to force actual execution.
  • Dataset Composition: To ensure comprehensive branch coverage, the 1024 pairs are evenly split (256 pairs each) across four scenarios:
    • Completely random pairs.
    • Identical pairs (absolute equality).
    • Partial matches (first 6 bytes identical / timestamp collision).
    • Near-matches (only the final byte differs).

2. Performance Optimizations

Fixed performance bottlenecks exposed by the new benchmark suite. Improved implementations for:

  • Equality Checking (Equals, ==, !=)
  • Comparison (CompareTo, >, >=, <, <=)
  • String Parsing (Parse, TryParse, implicit string to Ulid conversion)

3. Documentation & Metadata

  • Updated README.md with the revised benchmark results.
  • Refactored NuGet package metadata to improve SEO, discoverability, and tagging relevancy.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Other (please specify): Performance optimization

Checklist

  • The PR is submitted to the correct branch (main).
  • My code follows the project's coding style. (.editorconfig)
  • I have commented my code, particularly in hard-to-understand areas and public interfaces.
  • I have added or updated tests for the changes I made.
  • All new and existing tests passed.
  • I have updated the documentation where applicable.

@Seramis Seramis self-assigned this Jun 12, 2026
@Seramis Seramis merged commit 8d14356 into ByteAether:main Jun 12, 2026
5 checks passed
@Seramis Seramis deleted the benchmark_overhaul branch June 12, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant