[Lazarus] RE : Console App Development
Martin
lazarus at mfriebe.de
Sat Aug 13 12:13:01 CEST 2011
On 13/08/2011 08:23, Ludo Brands wrote:
>> as for apples and bananas:
>>
>> gvim does only open about 10 tabs !!!! not one tab per file.
>> At least my
>> installation. I can not open more tabs, or access any other
>> than the 10
>> tabs. I can from the buffer menu change the content of each tab, but
>> that's still only 10 tabs.
>>
> That obviously explains the bulk of the time difference. However, I think
> this is something we can learn from. Does lazarus have to load (+ highlight
> + ...) the files that are in tabs that are not even on the screen? Why not
> fe. load in the editor only the files in tabs initially visible (after
> startup/load project) and the others when tab actually opened (not when
> scrolling the tabs, but when selecting a tab).
That actually happens.
That explains the difference, between loading 450 files from command
line (27 secs) and the same 450 files as part of "project1 session" (16
secs)
It appears, that the "lock" responsible for this, only occurs during
opening the project (which is the common way in lazarus anyway), but not
during loading files from command line.
Lazarus defers the scan for highlight+folding (one and the same) as well
as finding the longest line (required for horiz scrollbar). Both of them
are done once lazarus is fully operational, within idle, or if the tab
is selected.
I realize for laptop user, the "idle operation" is undesired...
I do not know if Codetool scans are deferred however. (but afaik,
codetools do scan on request)
I do believe (comparing with gvim and MSEide) that simply opening 450
tabs (even without content) may take some deal of the time (I have not
tested that). It would explain at least some of the difference: gvim not
opening tabs / MSEide does not use the widgetset, hence it doesn't need
to allocate handles for each tab (I guess)
Again 450 files, is a benchmark only usage. Comparing against editors
that skip the actions of the benchmark is no use. Comparing with geany,
we actually look decent. And I don't even know if geany has something
like codetools...
> Similarly, unchanged files in
> editor tabs not opened since, say an hour, could be unloaded from the editor
> and free up some memory. In practice, on low memory system, these pages are
> already swapped to disk.
Which means unloading them, would actually be contra-productive. As you
would access the memory to free it, and have to swap it in from disk. If
the memory isn't touched then it want hurt anyone.
More information about the Lazarus
mailing list