Daniel Lemire's blog

, 2 min read

How smart is Swift with abstraction? A trivial experiment with protocols

4 thoughts on “How smart is Swift with abstraction? A trivial experiment with protocols”

  1. Rust version also inlines all the way to 800.

    https://godbolt.org/g/2gw5Tj

    1. That would have been my expectation, but thanks for checking!

  2. Elazar Leibovich says:

    Are you sure C would do that by default with two translation units?

    Is LTO on by default?

    1. That’s a fair point. In C and C++, you may end up with slower code.

      Point is: Swift does well in this instance.