Author Topic: Atlas Maker Popup is a CPU eater?  (Read 2963 times)

r.pedra

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 20
  • Posts: 131
    • View Profile
Atlas Maker Popup is a CPU eater?
« on: March 18, 2014, 05:17:11 AM »
Hi,
I noticed something with the Atlas Maker. I snapped it into the Unity main window and it is often displayed.
Everytime the Atlas Maker is displayed Unity needs 70% of CPU and when i switch on another tab of my layout in Unity, it gets back to a normal value.
I attached some screenshots to illustrates what I'm saying. (Same thing seems to happen with the Font maker)

Is this normal? Or is this something that you can optimize?

Seith

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 37
    • View Profile
    • SeithCG
Re: Atlas Maker Popup is a CPU eater?
« Reply #1 on: March 18, 2014, 06:18:07 AM »
That's weird I just noticed the same thing this morning in my project. The way I saw what was happening was by opening Unity's Profiler and checking "Profile Editor". The UIAtlas window was causing a lot of CPU work as it was constantly listening for changes and image file selection. So I closed the UIAtlas window and everything went back to normal.

I have always had the UIAtlas up in my layout and it never caused any problem before. But I had noticed something was wrong since the last NGUI update (or maybe the one before); Unity was slower than usual and "acting busy". It's just a coincidence that I managed to find out where that was coming from and I saw your message one hour later... :)
SeithCG.com

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Atlas Maker Popup is a CPU eater?
« Reply #2 on: March 18, 2014, 03:23:16 PM »
Interesting... I will look into this when I return from GDC.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Atlas Maker Popup is a CPU eater?
« Reply #3 on: March 18, 2014, 06:50:51 PM »
Sounds like something is going heavy work in a OnGUI script in UIAtlasMaker or something like that.

r.pedra

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 20
  • Posts: 131
    • View Profile
Re: Atlas Maker Popup is a CPU eater?
« Reply #4 on: March 27, 2014, 06:43:47 AM »
UP (In case the GDC erased your internal brain memory  :P )

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Atlas Maker Popup is a CPU eater?
« Reply #5 on: March 27, 2014, 07:25:25 AM »
It did! Thanks for the reminder.

You can fix it by modifying UIAtlasMaker.OnSelectAtlas function to this:
  1.         void OnSelectAtlas (Object obj)
  2.         {
  3.                 if (NGUISettings.atlas != obj)
  4.                 {
  5.                         NGUISettings.atlas = obj as UIAtlas;
  6.                         Repaint();
  7.                 }
  8.         }

r.pedra

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 20
  • Posts: 131
    • View Profile
Re: Atlas Maker Popup is a CPU eater?
« Reply #6 on: March 28, 2014, 08:08:49 AM »
Hi, it worked yesterday but today it's still eating my cpu.
DockAera.OnGUI have a 10ms cycle and 75.5Kb of allocation.(Still happening only when Atlas Maker is open).
It's falling to 1.4ms when I have the Atlas setted to None and nothing selected.(But my CPU is still at 80% )

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Atlas Maker Popup is a CPU eater?
« Reply #7 on: March 28, 2014, 08:39:46 AM »
Likely the Font Maker this time, not the atlas maker. It has the same exact function with the same problem.