Skip to content

Spinner versions 2 preview#40

Merged
Daniel-iel merged 58 commits intomainfrom
feature/performance-improve
Dec 25, 2025
Merged

Spinner versions 2 preview#40
Daniel-iel merged 58 commits intomainfrom
feature/performance-improve

Conversation

@Daniel-iel
Copy link
Owner

@Daniel-iel Daniel-iel commented Nov 29, 2025

Feature Description

This is a versions 2, this version contains a huge performance improviments

Problem Statement

The ond version was slow comparing with the version 2

Is your feature request related to a problem? Please describe.
Nothing.

Proposed Solution

This is for performance reletade

Example Usage

Alternatives Considered

Benefits

  • Performance improviment
  • Documentations improviment
  • New feature called interceptiors.

Potential Drawbacks

Implementation Complexity

  • High - Significant changes needed
  • Low - Simple change
  • Medium - Moderate effort required

Additional Context

Related Issues

@Daniel-iel Daniel-iel requested a review from Copilot November 29, 2025 23:23
@Daniel-iel Daniel-iel self-assigned this Nov 29, 2025
@Daniel-iel Daniel-iel added documentation Improvements or additions to documentation enhancement New feature or request labels Nov 29, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces Spinner version 2.0, a major architectural rewrite focused on performance improvements. The library transforms objects to/from fixed-width positional strings, commonly used for legacy system integration and financial data formats.

Key Changes:

  • Changed Spinner<T> from ref struct to sealed class (breaking change enabling async/await support)
  • Replaced constructor-based object passing with method parameters for WriteAsString(obj) and WriteAsSpan(obj)
  • Implemented compiled delegates replacing reflection for 10-50x faster property access
  • Added native type conversion support for 18+ primitive types without interceptors

Reviewed changes

Copilot reviewed 51 out of 52 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
src/global.json Updates SDK version to 10.0.100 (non-existent version)
src/Spinner/Spinner.csproj Updates target frameworks to include net10.0 (non-existent)
src/Spinner/Spinner.cs Core rewrite: sealed class, compiled delegates, ThreadStatic StringBuilder
src/Spinner/Internals/Guards/Guard.cs Simplified guard clauses to check property count vs individual properties
src/Spinner/Internals/Cache/InterceptorCache.cs Replaced Dictionary with ConcurrentDictionary, Type-based keys
src/Spinner/Interceptors/IInterceptor.cs Changed signature from object Parse(object) to string Parse(string)
src/Spinner.Test/*.cs Updated tests to use new API (object passed to methods, not constructor)
bench/Spinner.Benchmark/*.cs New benchmark files for v2.0 performance validation
docs/docs/*.md Comprehensive documentation including migration guide and performance benchmarks
README.md Extensive updates with performance stats, contribution guidelines, roadmap
Comments suppressed due to low confidence (1)

bench/Spinner.Benchmark/Models/PersonWithInterceptor.cs:38

  • Equals() method does not check argument type.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter
Copy link

codecov-commenter commented Dec 6, 2025

Codecov Report

❌ Patch coverage is 97.29730% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.87%. Comparing base (efe8d9a) to head (8d76dd6).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
src/Spinner/Spinner.cs 97.08% 0 Missing and 4 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##              main      #40      +/-   ##
===========================================
- Coverage   100.00%   97.87%   -2.13%     
===========================================
  Files            7        6       -1     
  Lines          129      188      +59     
  Branches        16       32      +16     
===========================================
+ Hits           129      184      +55     
- Partials         0        4       +4     
Flag Coverage Δ
?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Daniel-iel Daniel-iel merged commit 57b074f into main Dec 25, 2025
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants