performance - Layer-hosted NSView with lots of CALayers inside (WindowServer - CPU 100%) -


i have interesting case you. , need help.

my mac app has layer-hosted nsview lots of layers , sublayers , sub-sub layers inside. imagine finder window items (icons, text labels)... that. each item has button, selection background layer.

and fine until have 1000 of items.

now lots of items, app becomes unresponsive when try interact view. , tricky part is not app consumes cpu, windowserver. gets 100% , system freezes time.

important note:

my view part of app interface. there main window other views. have own structure well.

and i've noticed if put layer-hosted view separate window, works fine no freezes having same 1000 items. starts halt system if put main window.

the question

  1. what in app (views/layers) makes windowserver go mad?
  2. why placing view separate window helps?

i've run tests , removed sublayers every item, leaving one-two each. has reduced load on system, still bad. i've disabled drawings - small images icons. didn't well.

appreciate , comments. thanks!

eugene.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -