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

Comments

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.

Popular posts from this blog

Upcoming F# struct tuples: are they always faster?

Computing cryptography hashes: Rust, F#, D and Scala

Composing custom error types in F#