Benchpress

What Is The Quickest Way To Compare Types

(@ 2095 Mhz)

Multitype comparison

Technique RepeatCount Time RelativeSpeed Throughput
-is operator 100 00:00:00.004574 1x 21861.75/s
.GetType().Name 100 00:00:00.005284 1.16x 18924.7/s
.GetType() -eq 100 00:00:00.041669 9.11x 2399.85/s

Single Type comparison

Technique RepeatCount Time RelativeSpeed Throughput
-is operator 100 00:00:00.004543 1x 22011.89/s
.GetType().Name 100 00:00:00.006582 1.45x 15192.49/s
.GetType() -eq 100 00:00:00.007596 1.67x 13163.78/s