← Back to team overview

kicad-developers team mailing list archive

Re: PATCH: Raytracing - a more pleasing way sequencing blocks to render ?


Hi John,

yeah the Morton code is to improve cache hits.

Regarding the speed test, since OS are multi-tasking there could be some interference on the results so 1s difference is not a very measurable difference ( 4% ).
A possibility would be to run the same scene multiple times and make an average of the times.

On this small change proposed by Henner I wouldn't put into account the speed, as I hope (even with cache misses) there will not be a dramatic change on the render time.

Mario Luzeiro

From: John Beard <john.j.beard@xxxxxxxxx>
Sent: 01 May 2019 12:10
To: Mário Luzeiro; Henner Zeller; KiCad Developers
Subject: Re: [Kicad-developers] PATCH: Raytracing - a more pleasing way sequencing blocks to render ?

On 01/05/2019 10:53, Mário Luzeiro wrote:
> Hi Henner,

> I didn't get a chance to test the patch yet but
> I was thinking adding another options to implement some kind of spiral rendering from the center :) (as usually the board is centered)

Assuming the reason for the Morton code in the existing code is to
improve cache locality, it should work pretty well - each block is near
the previous one, though not as good as the Morton code, because we will
go around and do some "far" blocks before doing "near" blocks on the
next loop out, wasting/recaching some items.

However, as a fun test, this sort functor actually produces *better*
speeds (24s vs 25s)

     [&](const SFVEC2UI &a, const SFVEC2UI &b){ return !!(rand() % 2); }

So jumping around the blocks randomly actually *improves* speed. I don't
know why!



Follow ups