diff --git a/README.md b/README.md index 5f23dba..5a10ff5 100644 --- a/README.md +++ b/README.md @@ -11,14 +11,18 @@ If you need any additional functionality or further documentation, please see th ### Benchmark Results +Note that the benchmark results of this fork are slower than upstream due to the added vinculum notation support. +This benchmark tests the highest supported integer (3,999,999) while upstream tests with 3,999. + ```sh goos: linux goarch: amd64 pkg: github.com/rwinkhart/convertroman cpu: AMD Ryzen 9 3900X 12-Core Processor -BenchmarkFromInt-24 61993154 20.82 ns/op 0 B/op 0 allocs/op +BenchmarkFromInt-24 5372720 237.0 ns/op 24 B/op 1 allocs/op +BenchmarkFromIntCapital-24 2117424 570.9 ns/op 64 B/op 3 allocs/op PASS -ok github.com/rwinkhart/convertroman 1.827s +ok github.com/rwinkhart/convertroman 4.098s ``` ### Example diff --git a/convertroman_test.go b/convertroman_test.go index 8d4100e..c1d66ec 100644 --- a/convertroman_test.go +++ b/convertroman_test.go @@ -45,6 +45,13 @@ func TestFromInt(t *testing.T) { func BenchmarkFromInt(b *testing.B) { b.ReportAllocs() for i := 0; i < b.N; i++ { - _ = FromInt(3999) + _ = FromInt(3999999) + } +} + +func BenchmarkFromIntCapital(b *testing.B) { + b.ReportAllocs() + for i := 0; i < b.N; i++ { + _ = FromIntCapital(3999999) } }