Ways to Improve VCL Rendering Times - Delphi 236

  Рет қаралды 1,357

Alister Christie

Alister Christie

Күн бұрын

LearnDelphi.tv In this video, I did some experiments to see how I could improve the rendering performance of controls in the VCL when changing the layout of a form.

Пікірлер: 17
@Graham_Wideman
@Graham_Wideman 3 ай бұрын
Alister -- this demo runs spectacularly slowly compared to my experience with Delphi UIs, which triggers a suspicion that there's some excessive calculations going on. I see you have the buttons set to alClient, and I can't tell if the grid is set to adapt to size of contained controls... which could interact with each other. Regardless, it would clarify considerably if you would create a simple baseline case of just creating and showing 400 buttons that have a fixed height and width, position at constant Left and Top locations (as calculated by the create loop). You could do a similar test where your "redraw" button repositions and/or tesizes the buttons, again providing them with constant new positions/sizes. That would shed some light as to whether your current test case might be triggering some pathological recursive calculations or something else like recursive flood of events.
@galdariah
@galdariah 3 ай бұрын
"Just creating and showing 400 buttons that have a fixed height and width, position at constant Left and Top locations" The biggest VCL problem is when you must set the position (Top and Left) from another component.
@Graham_Wideman
@Graham_Wideman 3 ай бұрын
@@galdariah What do you mean by "set the position (Top and Left) from another component."
@galdariah
@galdariah 2 ай бұрын
​@@Graham_Wideman I made a mistake. In Delphi, to choose a position, we need to manually drag the component to adjust its position. For example, a TPanel with 5 TButtons aligned to alLeft. If you want to dynamically create these buttons, you have to create them in the corresponding order. LCL has a complex Anchor system, and that was my mistake.
@fburton8
@fburton8 2 ай бұрын
I agree, it seems terribly slow for this day and age. When I get time, I’ll try the same code on my legacy Delphi 7 system to see if that is any different. Edited to add: Using Delphi 7 on an HP Z2 Mini G4, I get ~1 second for a straight resize and ~0.5 seconds when I do the resizing with the visibility of the panel set to false. However, as TGridPanel isn't available in Delphi 7, I used a plain TPanel to trigger resizing and set the size and position of all the buttons inside the panel (and stored in an array) myself using SetBounds. This seemed more straightforward than messing with a TDrawGrid. Manually resizing the window still results in noticeably laggy UI performance though, so if I really wanted to get the effect of a 2D array of buttons in a snappy interface I would probably draw them myself.
@codegearguru
@codegearguru 2 ай бұрын
I think I'll need to re-try this laying out the buttons manually, rather than using the TGridPanel. It does seem to be slower than I would expect.
@MaximilianMusterma
@MaximilianMusterma 3 ай бұрын
Would be nice if you can check if there is any performance difference if you enable the new skia embedded Framework.
@codegearguru
@codegearguru 2 ай бұрын
Skia would help a fmx application - I'll give it a go at some point.
@fburton8
@fburton8 2 ай бұрын
I assume that BeginUpdate / EndUpdate isn’t applicable in this situation.
@galdariah
@galdariah 3 ай бұрын
I was expecting one last compilation with all these ways, lol. Embarcadero has much to improve on VLC speed, considering LCL is many times faster.
@JanDoggen
@JanDoggen 2 ай бұрын
Yes, a follow-up question is whether e.g. Visible := false in combination with SetBounds is better
@codegearguru
@codegearguru 2 ай бұрын
I'll probably do a follow up on this, probably using FMX and not using the TGridPanel with the VCL.
@codegearguru
@codegearguru 2 ай бұрын
Yes, it will likely be better as it reduces the number of times the components are re-rendered by half.
@freezer86
@freezer86 3 ай бұрын
Well.. it's not quite improving of rendering. BTW: You did not try to disable runtime themes (checkbox in Application->manifest) it's will "improve" unstyled version.
@codegearguru
@codegearguru 2 ай бұрын
It might be marginally faster, but didn't make a big difference.
Build Notepad.exe in Delphi - Delphi 231
34:29
Alister Christie
Рет қаралды 2,5 М.
Every parent is like this ❤️💚💚💜💙
00:10
Like Asiya
Рет қаралды 24 МЛН
Крутой фокус + секрет! #shorts
00:10
Роман Magic
Рет қаралды 36 МЛН
哈哈大家为了进去也是想尽办法!#火影忍者 #佐助 #家庭
00:33
火影忍者一家
Рет қаралды 115 МЛН
Kluster Duo #настольныеигры #boardgames #игры #games #настолки #настольные_игры
00:47
Logging Using Dependency Inversion - Delphi 238
42:21
Alister Christie
Рет қаралды 1,1 М.
Define Your Own Anonymous Method Types - Delphi 237
5:03
Alister Christie
Рет қаралды 885
Godot Ocean Waves
6:40
AntzGames
Рет қаралды 8 М.
Coding Was HARD Until I Learned These 5 Things...
8:34
Elsa Scola
Рет қаралды 536 М.
Why More People Dont Use Linux
18:51
ThePrimeTime
Рет қаралды 260 М.
How Windows Kernel Draws Graphics
10:59
Nir Lichtman
Рет қаралды 49 М.
7 Years of Software Engineering Advice in 18 Minutes
18:32
These Coding Projects Give You An Unfair Advantage
14:39
Harkirat Singh
Рет қаралды 355 М.
How To Make A Legit Sound Camera
16:15
Benn Jordan
Рет қаралды 228 М.
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 589 М.
Every parent is like this ❤️💚💚💜💙
00:10
Like Asiya
Рет қаралды 24 МЛН