Thursday, November 1, 2012

Clojure: Multimethods vs Protocols

Let's measure how much multimethods are slower that protocols:

  • multimethods are roughly as fast as protocols
  • clojure maps as fast as records
  • "class" notation is in order of magnitude slower than "map" notation

1 comment:

daniil said...

> "class" notation is in order of magnitude slower than "map" notation

Isn't this because there is reflection involved when calling .price? Type-hinting the argument should solve this.