Skip to content

Add StringSegment benchmarks#321

Merged
davidfowl merged 3 commits into
dotnet:devfrom
gfoidl:stringsegment-benchmark
Feb 27, 2018
Merged

Add StringSegment benchmarks#321
davidfowl merged 3 commits into
dotnet:devfrom
gfoidl:stringsegment-benchmark

Conversation

@gfoidl

@gfoidl gfoidl commented Feb 26, 2018

Copy link
Copy Markdown
Member
BenchmarkDotNet=v0.10.11, OS=ubuntu 17.10
Processor=Intel Xeon CPU 2.60GHz, ProcessorCount=2
.NET Core SDK=2.1.4
  [Host]     : .NET Core 2.0.5 (Framework 4.6.0.0), 64bit RyuJIT
  Job-NYQHGM : .NET Core 2.0.5 (Framework 4.6.0.0), 64bit RyuJIT

RemoveOutliers=False  Runtime=Core  Server=True  
Toolchain=.NET Core 2.0  LaunchCount=3  RunStrategy=Throughput  
TargetCount=10  WarmupCount=5  
Method Mean Error StdDev Op/s Gen 0 Allocated
Ctor_String 6.1938 ns 0.0558 ns 0.0836 ns 161,450,947.8 - 0 B
GetValue 3.2986 ns 0.1685 ns 0.2522 ns 303,154,762.2 - 0 B
Indexer 0.2526 ns 0.0091 ns 0.0136 ns 0.2496 ns 3,958,731,026.6 -
Equals_Object_Invalid 3.4613 ns 0.0601 ns 0.0900 ns 288,912,359.3 - 0 B
Equals_Object_Valid 11.8679 ns 0.1978 ns 0.2960 ns 84,260,973.3 - 0 B
Equals_Valid 6.0853 ns 0.0787 ns 0.1178 ns 164,331,267.7 - 0 B
Equals_String 8.1777 ns 0.0236 ns 0.0353 ns 122,284,384.5 - 0 B
GetHashCode 21.9225 ns 0.0661 ns 0.0989 ns 45,615,211.1 - 0 B
StartsWith 15.9217 ns 0.0959 ns 0.1436 ns 62,807,179.4 - 0 B
EndsWith 15.7556 ns 0.0701 ns 0.1049 ns 63,469,480.2 - 0 B
SubString 21.7661 ns 0.1461 ns 0.2186 ns 45,943,104.2 0.0005 32 B
SubSegment 26.0086 ns 0.5708 ns 0.8544 ns 38,448,752.4 - 0 B
IndexOf 10.7048 ns 0.2679 ns 0.4010 ns 93,416,223.0 - 0 B
IndexOfAny 21.2379 ns 0.5609 ns 0.8395 ns 47,085,709.4 - 0 B
LastIndexOf 10.3372 ns 0.3383 ns 0.5064 ns 96,737,556.7 - 0 B
Trim 79.6639 ns 1.2935 ns 1.9361 ns 12,552,736.8 - 0 B
TrimStart 42.6913 ns 1.0775 ns 1.6128 ns 23,423,963.4 - 0 B
TrimEnd 44.2018 ns 0.7579 ns 1.1344 ns 22,623,514.0 - 0 B

Without this file -- to be precise without the AspNetCoreBenchmark-Attribute -- no results will be logged.
@gfoidl

gfoidl commented Feb 26, 2018

Copy link
Copy Markdown
Member Author

/cc @rynowak

@davidfowl

Copy link
Copy Markdown
Member

Can we add a bigger string in one of them

* StartsWith
* EndsWith
* IndexOf
* IndexOfAny
* LastIndexOf
@gfoidl

gfoidl commented Feb 27, 2018

Copy link
Copy Markdown
Member Author

Added a larger one -> 6dfaf3f

Updated the numbers in the description based on the current code for the benchmarks.

@davidfowl
davidfowl merged commit a344c4f into dotnet:dev Feb 27, 2018
@gfoidl
gfoidl deleted the stringsegment-benchmark branch February 28, 2018 14:00
pakrym added a commit that referenced this pull request Feb 28, 2018
@ghost ghost locked as resolved and limited conversation to collaborators May 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants