On Monday, 19 June 2017 at 19:06:57 UTC, ag0aep6g wrote:
For me, alias_fun and op_apply are very close. If anything, alias_fun seems to be slightly faster.

Typical output (ldc2 -release -O3):
----
Avoiding bounds checking makes it faster for me (but is unsafe of course):

I took a deeper look into dub.
"--build=release" make almost all optimizations flags on, except noboundscheck. There is a "--build=release-nobounds" and with it, the numbers got a lot closer (checked on another pc so will not post the numbers now)

By the way, if I read it right, indexes is just `0 .. limit`, twice, isn't it? So there's no real point to it in the sample code. When I get rid of indexes and just count up to `limit`, all three versions perform the same. But I guess you're going to have arbitrary values in indexes when you actually use it.

Iep :)
I choose to keep the indexes 0..limit(and not for eg, random) just to not have cache misses interfering too much with the measurements.

Thanks!


Reply via email to