View Issue Details

IDProjectCategoryView StatusLast Update
0032560LazarusLCLpublic2020-04-16 14:35
ReporterVojtech Cihak Assigned ToZeljan Rikalo  
Status feedbackResolutionopen 
Product Version1.9 (SVN) 
Summary0032560: ThemeServices.DrawText(); performance diversity
DescriptionThemeServices.DrawText(); on Qt is 4-30x slower than on GTk2 or Wine.

ThemeServices.DrawText(); on Qt - TBitmap.Canvas is 1.5-6x slower than TPaintBox.Canvas.

  Rendering to TBitmap is in average faster (~ 20%).
  Flag DT_NOCLIP causes 10% faster even if longer text is rendered. It is unusual, rendering of text is expensive operation.
  Rendering LongString is 30% slower even if the same amount of text is rendered (because of aRect-clip).

  Rendering to Bitmap is in average faster (<10%).
  Flag DT_NOCLIP causes slower - expected, longer text is rendered.
  Rendering LongString is 30% slower even if the same amount of text is rendered (because of aRect-clip).

  Flag DT_NOCLIP has no effect - unexpected, longer text is rendered.
Steps To ReproduceAny widgetset:
1) Run demo.
2) Try both buttons with any combination of checkboxes.

+ There is something wrong with Qt:
1) Run demo
2) Press 1.btn
3) Switch on "LongString"
4) Press 1.btn
5) Switch off "LongString"
6) Press 1.btn

Now demo runs much faster.
Additional InformationLazarus 1.9.0 r56055 FPC 3.0.2 x86_64-linux-qt
Lazarus 1.6.4 r54278 FPC 3.0.2 i386-win32-win32/win64
TagsNo tags attached.
Fixed in Revision
WidgetsetGTK 2, Win32/Win64, QT
Attached Files


related to 0035108 assignedZeljan Rikalo Qt Text quality on TBitmap 


Vojtech Cihak

2017-10-16 21:53

reporter (3,832 bytes)

Zeljan Rikalo

2019-02-19 18:46

developer   ~0114266

Just tested Qt4 vs Qt5 on linux 64bit and Qt5 is minimum 4x faster than Qt4.
Note that both have same code in case of rendering. Please test with Qt5 and then compare it with Gtk2.
Also, I did not understand what do you mean by ?
  Flag DT_NOCLIP has no effect - unexpected, longer text is rendered.

When DT_NOCLIP is enabled it should render text to the maximum of canvas size,
otherwise it is clipped into rect parameter - and that's how it works in Qt4 and Qt5.

Zeljan Rikalo

2019-02-19 19:11

developer   ~0114268

I'm suspecting QStyle_drawItemText() for slowness, and it's deep in Qt4 libs...

Zeljan Rikalo

2019-02-20 18:46

developer   ~0114308

Basically, Qt4 QPainter_drawText() is much slower than under Qt5. IMO this is Qt4 design problem and nothing else.

Zeljan Rikalo

2020-04-16 14:35

developer   ~0122174

@Vojtech, if you agree I'll resolve this issue as "no change required" since problem is in Qt4 design. See Qt5 speed.

Issue History

Date Modified Username Field Change
2017-10-16 21:53 Vojtech Cihak New Issue
2017-10-16 21:53 Vojtech Cihak File Added:
2017-10-16 22:03 Juha Manninen LazTarget => -
2017-10-16 22:03 Juha Manninen Description Updated View Revisions
2019-02-19 18:37 Zeljan Rikalo Assigned To => Zeljan Rikalo
2019-02-19 18:37 Zeljan Rikalo Status new => assigned
2019-02-19 18:39 Zeljan Rikalo Relationship added related to 0035108
2019-02-19 18:46 Zeljan Rikalo Note Added: 0114266
2019-02-19 18:46 Zeljan Rikalo Status assigned => feedback
2019-02-19 19:11 Zeljan Rikalo Note Added: 0114268
2019-02-20 18:46 Zeljan Rikalo Note Added: 0114308
2020-04-16 14:34 Zeljan Rikalo Status feedback => acknowledged
2020-04-16 14:35 Zeljan Rikalo Status acknowledged => feedback
2020-04-16 14:35 Zeljan Rikalo Note Added: 0122174