https://github.com/vasily-kirichenko/coreapp33
https://github.com/vasily-kirichenko/coreapp33
fsharp
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/vasily-kirichenko/coreapp33
- Owner: vasily-kirichenko
- Created: 2017-11-06T08:38:53.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-06T08:54:15.000Z (over 8 years ago)
- Last Synced: 2025-02-08T08:11:09.089Z (over 1 year ago)
- Topics: fsharp
- Language: F#
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is Jaro-Winkler algorithm taken from https://github.com/Microsoft/visualfsharp/blob/master/src/utils/EditDistance.fs (`Base` benchmark), then optimized (`Opt`) and the `Opt` + `ArrayPool` to eliminate allocation entirely.
``` ini
BenchmarkDotNet=v0.10.10, OS=Windows 10 Redstone 2 [1703, Creators Update] (10.0.15063.674)
Processor=Intel Core i7-4790K CPU 4.00GHz (Haswell), ProcessorCount=8
Frequency=3906255 Hz, Resolution=255.9997 ns, Timer=TSC
.NET Core SDK=2.1.1-preview-007094
[Host] : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT
DefaultJob : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT
```
| Method | Mean | Error | StdDev | Scaled | Gen 0 | Allocated |
|------------- |---------:|----------:|----------:|-------:|-------:|----------:|
| Base | 487.8 ns | 3.9748 ns | 3.7180 ns | 1.00 | 0.2661 | 1120 B |
| Opt | 179.3 ns | 0.8057 ns | 0.7537 ns | 0.37 | 0.0226 | 96 B |
| OptArrayPool | 282.6 ns | 1.0996 ns | 1.0286 ns | 0.58 | - | 0 B |
Conclusion: allocations are not always your enemy.