No video

Ways to Improve VCL Rendering Times - Delphi 236

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

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 Ай бұрын
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 Ай бұрын
"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 Ай бұрын
@@galdariah What do you mean by "set the position (Top and Left) from another component."
@galdariah
@galdariah Ай бұрын
​@@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 Ай бұрын
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 29 күн бұрын
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 Ай бұрын
Would be nice if you can check if there is any performance difference if you enable the new skia embedded Framework.
@codegearguru
@codegearguru Ай бұрын
Skia would help a fmx application - I'll give it a go at some point.
@fburton8
@fburton8 Ай бұрын
I assume that BeginUpdate / EndUpdate isn’t applicable in this situation.
@galdariah
@galdariah Ай бұрын
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 Ай бұрын
Yes, a follow-up question is whether e.g. Visible := false in combination with SetBounds is better
@codegearguru
@codegearguru 29 күн бұрын
I'll probably do a follow up on this, probably using FMX and not using the TGridPanel with the VCL.
@codegearguru
@codegearguru 29 күн бұрын
Yes, it will likely be better as it reduces the number of times the components are re-rendered by half.
@freezer86
@freezer86 Ай бұрын
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 Ай бұрын
It might be marginally faster, but didn't make a big difference.
Build Notepad.exe in Delphi - Delphi 231
34:29
Alister Christie
Рет қаралды 2,3 М.
WebP Support in Skia - New in Delphi 12 - 227
28:36
Alister Christie
Рет қаралды 2,4 М.
What will he say ? 😱 #smarthome #cleaning #homecleaning #gadgets
01:00
Пройди игру и получи 5 чупа-чупсов (2024)
00:49
Екатерина Ковалева
Рет қаралды 4,1 МЛН
КТО ЛЮБИТ ГРИБЫ?? #shorts
00:24
Паша Осадчий
Рет қаралды 3,3 МЛН
Reduce the Memory Required to Build Your Project - Delphi 229
16:03
Alister Christie
Рет қаралды 1,4 М.
The World Depends on 60-Year-Old Code No One Knows Anymore
9:30
Coding with Dee
Рет қаралды 756 М.
It's time for change, it's time for Linux.
10:53
DankPods
Рет қаралды 371 М.
Interview with a Senior C# Developer
10:56
Programmers are also human
Рет қаралды 626 М.
The AMA Club Model is Failing. Here's Why.
16:10
Tail Heavy Productions
Рет қаралды 40 М.
This NEW AI Chip From Huawei DESTROYS NVIDIA
9:37
Tech Pulse Pro
Рет қаралды 24 М.
Never install locally
5:45
Coderized
Рет қаралды 1,8 МЛН
It’s time to move on from Agile Software Development (It's not working)
11:07
What will he say ? 😱 #smarthome #cleaning #homecleaning #gadgets
01:00