Recent

Author Topic: Slow editor on Mac  (Read 41996 times)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Slow editor on Mac
« Reply #15 on: February 03, 2014, 08:51:01 pm »
Ok, I may have found something, but I need to get our carbon expert on it.

It seems, that when a tiny bit (1 or 2 lines need repaint) the cliprect (which specifies the area) does not work.

So the editor paints all.

The caret triggers a paint of the area, where it was, each time it gets hidden. That are a few pixel, but due to the issue, it is a full repaint.

However, that does not link to the code size (unit of 30, or 700 lines).

Hoch

  • New Member
  • *
  • Posts: 35
Re: Slow editor on Mac
« Reply #16 on: February 04, 2014, 12:36:46 pm »
@Martin_fr

I deleted the file EditorOptions.xml and recompiled Lazarus commenting the line you suggest in SynEdit.pp but it does not fix the issue, there's still high CPU usage when I have the Source Editor window selected and the blinking cursor visible.

What you suggest about the full repaints makes a lot of sense.

Hope you can fix this soon. Right now editing, scrolling and debugging feels really choppy here.

Thanks again for the support and fast answer! :)

Hoch.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Slow editor on Mac
« Reply #17 on: February 04, 2014, 01:17:59 pm »
I handed it to a colleague in the team.

He just reported back. So far a fix in trunk (1.3). Decission on merging (1.2) still needs to be done.

Revision: 43872
Author: dmitry
Date: 04 February 2014 05:17:45
Message:
carbon: minimize the custom view invalidation to reduce resources use
----
Modified : /trunk/lcl/interfaces/carbon/carbonprivate.pp

Attached is a patch. You can try that against 1.2RC


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Slow editor on Mac
« Reply #18 on: February 04, 2014, 01:46:48 pm »
I am just testing. It seems to fix the speed, but introduces issues scrolling...

Hoch

  • New Member
  • *
  • Posts: 35
Re: Slow editor on Mac
« Reply #19 on: February 04, 2014, 10:21:50 pm »
@Martin_fr,

I'm testing the patch and it seems to fix the high cpu usage when viewing the blinking cursor.

before the patch cpu usage was 40% with antialiasing on. Now it goes down to more logical 0,5% with antialising on.

Typing is faster but cpu usage when typing moderately fast is very high (50-60%).

Scroll is not fixed. It is as it was, too jumpy and slow with very high cpu usage (almost 90%).

Maybe too many redraws when scrolling?

Thanks and greetings! :)

Hoch.

Hoch

  • New Member
  • *
  • Posts: 35
Re: Slow editor on Mac
« Reply #20 on: February 06, 2014, 06:02:51 pm »
@Martin_fr,

Window resize, scroll with slider and with scroll wheel are very slow (high cpu usage).

Any possibilities of fixing this?

With those fixes, the editor would reach near perfection on Mac OS! :)

Thanks and greetings! :)

Hoch.


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Slow editor on Mac
« Reply #21 on: February 06, 2014, 06:59:50 pm »
As I said, it is a colleague of mine who looks at it.

I maintain SynEdit, however this problem is caused by the underlying carbon widget code in the LCL. And that is maintained by someone else.

When he gets back, I will let you know.

Hoch

  • New Member
  • *
  • Posts: 35
Re: Slow editor on Mac
« Reply #22 on: February 06, 2014, 08:03:34 pm »
@Martin_fr,

Ok! Great!

Thanks! :)

Hoch.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Slow editor on Mac
« Reply #23 on: February 06, 2014, 10:25:12 pm »
there should more updates through this weekend. please wait.

Hoch

  • New Member
  • *
  • Posts: 35
Re: Slow editor on Mac
« Reply #24 on: February 07, 2014, 12:27:46 pm »
@skalogryz,

Ok. Thank you! Looking forward to have good news from you!

The patch you issued does make a *huge difference*.

Lazarus feels much faster and the fans of my Macbook are quiet now, less CPU usage also means less watt consumption and less CO2 emissions! :-)

Hope you can fix the scroll and typing issues.

Keep up the good work, guys! The Lazarus editor is one of the best!!

Happy Pascal coding and Greetings! :)

Hoch.

Hoch

  • New Member
  • *
  • Posts: 35
Re: Slow editor on Mac
« Reply #25 on: February 11, 2014, 04:26:07 pm »
@skalogryz,

Any news?...

Thanks and greetings :)

Hoch.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Slow editor on Mac
« Reply #26 on: February 11, 2014, 07:23:47 pm »
No updates, sorry. Didn't get enough time to debug and fix properly.
We'll try to work some night this week.

One thing that could help: is it possible for you to create a stand-alone project with SynEdit that shows the problem?

Hoch

  • New Member
  • *
  • Posts: 35
Re: Slow editor on Mac
« Reply #27 on: February 12, 2014, 01:19:52 pm »
@skalogryz,

It is easy to reproduce.

Just execute Lazarus on Mac Os, open a long unit and scroll with the slider or the mouse wheel.

You will notice that the scroll is slow and jumpy and that the CPU usage is very high.

Same thing when you type moderatly fast. But it is not as annoying as the scroll issue.

Thanks and Greetings! :)

Hoch.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Slow editor on Mac
« Reply #28 on: February 13, 2014, 04:27:06 am »
@skalogryz,

It is easy to reproduce.

Just execute Lazarus on Mac Os, open a long unit and scroll with the slider or the mouse wheel.

You will notice that the scroll is slow and jumpy and that the CPU usage is very high.

Same thing when you type moderatly fast. But it is not as annoying as the scroll issue.

Thanks and Greetings! :)

Hoch.
could you please test the following project. Is there any difference in CPU usage between No Paint TextOut and ExtTextOut?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Slow editor on Mac
« Reply #29 on: February 13, 2014, 05:41:47 pm »
Scrolling may indeed be an issue. That code does not work for me either....

As for typing text, please try in the Options (Editor/display) to hide the "overview gutter", this may speed up things a little.


 

TinyPortal © 2005-2018