Typely
GitHub
  • Overview
    • πŸ‘Welcome!
  • Validations
    • πŸ“Common
    • πŸ”’Number
    • βš–οΈComparable
    • ✏️String
  • Customize errors
    • 🌎Localization
    • πŸ”Sensitive data
  • General
    • 🧩Class VS Struct
    • πŸ–ΌοΈSupported frameworks
    • πŸš€Benchmarks
    • ⚠️Limitations
  • Design decisions
    • πŸ”„Conversions
    • ℹ️Use of interfaces
    • πŸ€Έβ€β™‚οΈUnderlying type comparison
    • πŸ’‚Validations
Powered by GitBook
On this page
  • Equality
  • Primitives
  • Value objects
Edit on GitHub
  1. General

Benchmarks

PreviousSupported frameworksNextLimitations

Last updated 12 months ago

Equality

Typely doesn't use the generic EqualityComparer and is therefore faster than records. Benchmark .

Primitives

Int

Method
Mean
Error
StdDev
Median
Allocated

Int_EqualOperator

0.0028 ns

0.0053 ns

0.0050 ns

0.0000 ns

-

Int_EqualityComparer

0.0018 ns

0.0031 ns

0.0027 ns

0.0004 ns

-

Int_Equals

0.0000 ns

0.0001 ns

0.0001 ns

0.0000 ns

-

String

Method
Mean
Error
StdDev
Allocated

String_EqualOperator

2.4031 ns

0.0227 ns

0.0212 ns

-

String_EqualityComparer

5.0523 ns

0.0305 ns

0.0270 ns

-

String_Equals

0.5165 ns

0.0206 ns

0.0182 ns

-

String_StaticEquals

2.4197 ns

0.0249 ns

0.0208 ns

-

Guid

Method
Mean
Error
StdDev
Allocated

Guid_EqualOperator

1.608 ns

0.0062 ns

0.0052 ns

-

Guid_EqualityComparer

1.659 ns

0.0358 ns

0.0335 ns

-

Guid_Equals

1.334 ns

0.0236 ns

0.0197 ns

-

Value objects

Int

Method
Mean
Error
StdDev
Median
Allocated

ValueObjectInt_EqualityComparer

0.0013 ns

0.0021 ns

0.0018 ns

0.0006 ns

-

ValueObjectInt_Equals

0.0148 ns

0.0115 ns

0.0108 ns

0.0133 ns

-

String

Method
Mean
Error
StdDev
Allocated

ValueObjectString_EqualityComparer

5.228 ns

0.0702 ns

0.0657 ns

-

ValueObjectString_Equals

2.643 ns

0.0417 ns

0.0370 ns

-

πŸš€
here