Re: [Kicad-developers] [PATCH] Don't use the RTREE in UpdateAllLayersOrder() / UpdateAllLayersColor()

2018-02-26 Thread Maciej Sumiński
Alright, thank you for quick verification. I have just committed the fix to the master branch. Cheers, Orson On 02/26/2018 05:12 PM, Jon Evans wrote: > Sounds good to me. 1% hit should not cancel out the gains from not using > the RTree in large worlds (I saw layer-switch time drop from ~80ms

Re: [Kicad-developers] [PATCH] Don't use the RTREE in UpdateAllLayersOrder() / UpdateAllLayersColor()

2018-02-26 Thread Jon Evans
Sounds good to me. 1% hit should not cancel out the gains from not using the RTree in large worlds (I saw layer-switch time drop from ~80ms to ~30ms on my machine) We can consider revisiting this later to eliminate the need for dynamic_cast by ensuring that anything that VIEW calls on an item it

Re: [Kicad-developers] [PATCH] Don't use the RTREE in UpdateAllLayersOrder() / UpdateAllLayersColor()

2018-02-26 Thread Maciej Sumiński
Apparently clang analyzer has been correct this time. It turns out that PCB_PAINTER::Draw() and PCB_RENDER_SETTINGS::GetColor() assume that all objects are EDA_ITEMs, which is not true for VIEW_GROUP class. When a layer is changed, VIEW::UpdateAllLayersColor() iterates through all VIEW_ITEMs and

Re: [Kicad-developers] [PATCH] Don't use the RTREE in UpdateAllLayersOrder() / UpdateAllLayersColor()

2018-02-26 Thread Wayne Stambaugh
Orson, That's what I was doing so it sounds like it might be something with your setup. Wayne On 2/26/2018 9:30 AM, Maciej Sumiński wrote: > Wayne, > > I meant selecting any layer in the right-hand layer widget. Perhaps it > is a false positive in clang analyzer, I will have a look at it.

Re: [Kicad-developers] [PATCH] Don't use the RTREE in UpdateAllLayersOrder() / UpdateAllLayersColor()

2018-02-26 Thread Maciej Sumiński
Wayne, I meant selecting any layer in the right-hand layer widget. Perhaps it is a false positive in clang analyzer, I will have a look at it. Pcbnew does not crash here when built with gcc (and no analyzer enabled). Cheers, Orson On 02/26/2018 03:02 PM, Wayne Stambaugh wrote: > Orson, > >

Re: [Kicad-developers] [PATCH] Don't use the RTREE in UpdateAllLayersOrder() / UpdateAllLayersColor()

2018-02-26 Thread Wayne Stambaugh
Orson, What do you mean by "any layer switching"? I am not have any issues on windows when selecting a different layer in the layer manager using either canvas when launched from kicad or stand alone mode. Cheers, Wayne On 2/26/2018 5:01 AM, Maciej Sumiński wrote: > Jon, > > With this patch

Re: [Kicad-developers] [PATCH] Don't use the RTREE in UpdateAllLayersOrder() / UpdateAllLayersColor()

2018-02-26 Thread Jon Evans
Hi Orson, I don't see that behavior, but I don't have asan turned on right now either so maybe it isn't deterministic without it. I won't be able to look at this issue until tonight, so please revert for now unless you find a simple fix (I guess maybe preview items are missing some initialization

Re: [Kicad-developers] [PATCH] Don't use the RTREE in UpdateAllLayersOrder() / UpdateAllLayersColor()

2018-02-26 Thread Maciej Sumiński
Jon, With this patch applied, any layer switching in pcbnew leads to a crash, even with no layout loaded. Can anyone else confirm this? See the the attached address sanitizer report for details. Regards, Orson On 02/25/2018 10:01 PM, Jon Evans wrote: > This patch uses simple iteration instead

Re: [Kicad-developers] [PATCH] Don't use the RTREE in UpdateAllLayersOrder() / UpdateAllLayersColor()

2018-02-25 Thread Wayne Stambaugh
Patch merged. Thanks! On 02/25/2018 04:01 PM, Jon Evans wrote: This patch uses simple iteration instead of the RTREE search to update the layer order and color in VIEW.  On my Linux system, this results in a ~50% speedup in release build (less in debug build) and is most noticeable when

Re: [Kicad-developers] [PATCH] Don't use the RTREE in UpdateAllLayersOrder() / UpdateAllLayersColor()

2018-02-25 Thread Wayne Stambaugh
Patch merged. Thanks! On 02/25/2018 04:01 PM, Jon Evans wrote: This patch uses simple iteration instead of the RTREE search to update the layer order and color in VIEW.  On my Linux system, this results in a ~50% speedup in release build (less in debug build) and is most noticeable when

[Kicad-developers] [PATCH] Don't use the RTREE in UpdateAllLayersOrder() / UpdateAllLayersColor()

2018-02-25 Thread Jon Evans
This patch uses simple iteration instead of the RTREE search to update the layer order and color in VIEW. On my Linux system, this results in a ~50% speedup in release build (less in debug build) and is most noticeable when switching layers in GerbView with large Gerber files loaded (i.e. high