Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 29 additions & 65 deletions CHANGELOG.md

Large diffs are not rendered by default.

23 changes: 9 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Thank you for your interest in contributing to TagLibSharp2! This document provi
## Getting Started

1. Fork the repository
2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/tagsharp.git`
2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/TagLibSharp2.git`
3. Create a branch: `git checkout -b feature/your-feature-name`
4. Make your changes
5. Run tests: `dotnet test`
Expand All @@ -16,7 +16,7 @@ Thank you for your interest in contributing to TagLibSharp2! This document provi

### Prerequisites

- .NET 8.0 SDK or later
- .NET 10 SDK or later (it builds every target framework)
- Your preferred IDE (VS Code, Visual Studio, Rider)

### Build & Test
Expand Down Expand Up @@ -109,7 +109,7 @@ We use MSTest. Tests should be:
[TestMethod]
public void AddUInt32BE_WritesCorrectBytes ()
{
var builder = new BinaryDataBuilder ();
using var builder = new BinaryDataBuilder ();

builder.AddUInt32BE (0x12345678);

Expand Down Expand Up @@ -158,24 +158,19 @@ Benchmark when modifying:
### Performance Guidelines

1. **Avoid allocations in hot paths** - Use `Span<T>` and `stackalloc`
2. **Use `[AggressiveInlining]`** - For small, frequently-called methods (all `Add*` methods use this)
2. **Use `[AggressiveInlining]`** - For small, frequently-called methods (the fixed-width integer `Add*` methods use this)
3. **Pre-size builders** - When final size is known
4. **Prefer `.Span` over `.Slice()`** - Span is zero-copy; Slice allocates

### Benchmarking (Future)
### Benchmarking

For significant performance changes, benchmarks will be added to `tests/TagLibSharp2.Benchmarks/`:
`benchmarks/TagLibSharp2.Benchmarks` uses BenchmarkDotNet. `MediaFileReadBenchmark` measures one `MediaFile.Read` of an MP3, a WAV and a FLAC file with a 1 MiB payload; the number to watch is Allocated, which should stay far under the payload. Run it with:

```csharp
[MemoryDiagnoser]
public class BinaryDataBenchmarks
{
[Benchmark]
public void ParseHeader_1KB () { ... }
}
```bash
dotnet run -c Release --project benchmarks/TagLibSharp2.Benchmarks -f net10.0 -- --filter '*'
```

Run with: `dotnet run -c Release --project tests/TagLibSharp2.Benchmarks`
`-- --list flat` lists the benchmarks. `-- --scan [rounds]` reads the three sample files repeatedly and prints the time; `-- --scan --retain` keeps every result and prints `READY` so a memory profiler can attach. For a significant performance change, add a benchmark beside the existing one.

## Architecture

Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Copyright>Copyright (c) 2025-2026 Stephen Shaw and contributors</Copyright>

<!-- Version: Set via CI or use default for local builds -->
<ReleaseVersion Condition="'$(ReleaseVersion)' == ''">0.6.0</ReleaseVersion>
<ReleaseVersion Condition="'$(ReleaseVersion)' == ''">0.7.0</ReleaseVersion>
<VersionSuffix Condition="'$(VersionSuffix)' == '' And '$(CI)' == ''">dev</VersionSuffix>

<!-- Repository Info -->
Expand Down
71 changes: 51 additions & 20 deletions README.md

Large diffs are not rendered by default.

Loading
Loading