Re: slow startup on windows

Enno Rehling <[email protected]> Fri, 25 Oct 2024 16:27:35 +0200
Newsgroups gmane.comp.lib.fox-toolkit.user
Message-ID <[email protected]>
I second what Roland says, don't load all those strings into memory, or 
at least not into FXString objects, if you can at all help it.

Now, there's a chance you've got the strings in a big file that is NOT a 
relational database, and you need to search through them in some form. 
That still doesn't mean they all need to be an FXString (unless you plan 
to display each and every one of them in a widget). Memory allocation 
via new or malloc is expensive (more so with poorly written allocators 
or on certain operating systems), and you want to avoid it as much as 
you can.

Depending on your input file format, perhaps you can just mmap [1] that 
file into memory and index it in some other way? Of course then you need 
to write custom code for Windows [2], because the WIN32 API is special.

Enno.

References:
[1] https://www.man7.org/linux/man-pages/man2/mmap.2.html
[2] https://learn.microsoft.com/en-us/windows/win32/memory/file-mapping