Re: slow startup on windows

[email protected] Wed, 26 Apr 2023 11:14:55 -0500
Newsgroups gmane.comp.lib.fox-toolkit.user
Message-ID <[email protected]>
On 2023-04-26 10:08, John Selverian wrote:
> I must be missing something, I open a PowerShell window and run:
> 
> ./MPDB_win_debug -tracelevel 100
> 
> The program starts, then I exit it but I do not see any output,
> I'm assuming it would output to the PowerShell window I started
> it from.

I assume the code has been compiled with -DDBUG=1 and NOT with 
-DNDEBUG=1 ??

You will never see trace output if the pre-processor has defined 
FXTRACE()
as empty:

   #ifndef NDEBUG
   #define FXTRACE(arguments) FX::fxtrace arguments
   #else
   #define FXTRACE(arguments) ((void)0)
   #endif

Optimized, release mode (--enable-release) will defined NDEBUG.  Debug
build (--enable-debug), or "vanilla" (no options) will not set NDEBUG.

If you're using DLLs, make sure the DLL your actually referencing is
the one compiled with debug mode.

On Windows, trace output is sent to "Debug Window" as well as stderr
when _WINDOWS has been set [the debug window should show the output
in VC++]].

I can check tonight when I get back home if all this works as expected
with some other FOX programs.

FYI i've never seen the weird slowdown; maybe the size of the s/w
matters, and I'm simply not seeing it due to running smaller apps.

You can add a "debug" menu option to dump widget tree, send
ID_DUMP to FXApp instance, it will recursively dump the entire
widget tree in existance at the time [or call app->dumpWidgets()
directly, of course...].

#ifdef DEBUG
   new FXMenuCommand(helpmenu,"&Dump 
Widgets",nullptr,getApp(),FXApp::ID_DUMP);
#endif

You can see if there are unusual numbers of widgets; 10s of thousands
is probably OK, but 100s of thousands may be problematic.


          -- JVZ