Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2018-12

In windows 10 (64bit) Assigning TFrame.parent to a TForm took 10 more seconds than Windows 7 (64 bit)

4 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Dennis

I am using FPC 3.1.1  + Lazarus 1.9.0 running on windows 10 (64 bit) to generate windows exe of 64 bit.

I logged the timestamps before and after parent assignment in my     constructor TMyFrame.CreateWith(aForm : TForm);
....
MyFrame.Parent := aForm (where aForm is the main application window). ......

In windows 10 (64 bit)
18-12-19 00:06:10.154 Before Set parent( old parent = nil ) 18-12-19 00:06:23.983 After Set parent

it took 13.9 seconds

In windows 7 (64 bit)

18-12-19 00:07:45.916 Before Set parent( old parent = nil ) 18-12-19 00:07:48.939 After Set parent
it only took 3 seconds.

what could possibly be the cause of the extra 10 seconds in windows 10 ?

The hardware is same. In fact, the windows 7 (64 bit) is a virtualbox running on the windows 10, so it should be slower.

Dennis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20181219/cf7f9250/attachment.html>

Reply by email

Marcos Douglas B. Santos
to Dennis
PM Dennis wrote 24 lines
I am using FPC 3.1.1 + Lazarus 1.9.0 running on windows 10 (64 bit) to generate windows exe of 64 bit. I logged the timestamps before and after parent assignment in my constructor TMyFrame.CreateWith(aForm : TForm); .... MyFrame.Parent := aForm (where aForm is the main application window). ...... In windows 10 (64 bit) 18-12-19 00:06:10.154 Before Set parent( old parent = nil ) 18-12-19 00:06:23.983 After Set parent it took 13.9 seconds In windows 7 (64 bit) 18-12-19 00:07:45.916 Before Set parent( old parent = nil ) 18-12-19 00:07:48.939 After Set parent it only took 3 seconds. what could possibly be the cause of the extra 10 seconds in windows 10 ? The hardware is same. In fact, the windows 7 (64 bit) is a virtualbox running on the windows 10, so it should be slower.

Maybe a simple - but complete - example on code can help. I've been using "dynamics frames" since WinXP (maybe before) and I haven't seen any penalty (like 10 seconds) of time among those versions.

best regards,
Marcos Douglas

Reply by email

Sergey Bodrov
to Dennis: I am using FPC 3.1.1  + Lazarus 1.9.0 running on windows 10 (64 bit) to generate windows…

I encounter same trouble in Lazarus 1.0, and not remember, that it appear in 1.2+ Maybe there some kind of code degradation?

Workaround is:
1. Assign TFrame.Parent after creating TFrame, not in TFrame constructor.
2. When you create controls programmatically, make their parent (form, frame, panel..) Visible := False
3. Do not create many similar frames instances, re-use already created frames if possible. For example, for TPageControl with many similar frames better using TTabControl and change content in one frame. And when that frame not needes, just make it invisible.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20181219/9af111b4/attachment.html>

Reply by email