[swift-users] Fwd: Design and performance of Vector2/3/4 and Matrix

David Turnbull dturnbull at gmail.com
Fri Dec 18 17:13:31 CST 2015


On Fri, Dec 18, 2015 at 1:36 PM, Joe Groff <jgroff at apple.com> wrote:

> Do you have the optimizer enabled (using -O)? I see inlining happening as
> you'd expect.
>

Thanks for looking at this. Nobody else here who can check my work.

Last time I tested not-as-a-module it wasn't inlining. Perhaps in that case
I didn't have -O because of something I didn't understand about Xcode. This
time around I added -O to the debug build instead of trying to build for
release. It did inline all my test cases.

When it does inline it's making nice assembly. Even the subscript turns
into exactly the same as myvec.x. So that's pretty awesome.

But it still doesn't inline for me across modules even with -O
-whole-module-optimization. Only the myvec.x cases get inlined. I suspect
this just isn't working and might come in time.

It's good enough for now. At least I don't have to write the internals with
the clumsy mymatrix.w.y style instead of mymatrix[3][1].

-david (https://github.com/AE9RB/SwiftGL)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20151218/bb5a8dc1/attachment.html>


More information about the swift-users mailing list