Page 1 of 1

FH Plugin debug window runs very slowly

Posted: 27 May 2022 08:26
by Talln
Hi

Does anyone have any advice for how to get the FH plugin debug window in FH to run programs at a 'normal' speed?

My experience is that my code runs 50 times slower in the debug window than when run directly from the Plugin window... even after I've turned off Debug Mode and unchecked all the variable types with no discernible impact.

So I'm now running the plugin from the FH Plugin window and then debugging by feel (or writing FHMessageBoxes or outputting debug data to an external log file which is awkward).

My program is 2000+ lines long and processes a 6000+ person FH database....but the whole thing runs in 45 secs in FH direct, while it had only got to 10% in 4 minutes when run in the debug window with Debug Mode off. I don't have 40 minutes to run the plugin for each test run!

Any suggestions?

Thanks in anticipation.

Paul

Re: FH Plugin debug window runs very slowly

Posted: 27 May 2022 08:39
by Mark1834
That's my experience as well. Any options for testing the plugin with a smaller dataset? Are there any steps in there that are likely to be particularly slow and resource-hogging?

Re: FH Plugin debug window runs very slowly

Posted: 27 May 2022 09:00
by tatewise
I agree with Mark. For debugging, you need a small but representative subset of your FH database that explores all the conditional paths within your plugin script. There may also be run time improvements that could speed it up.

Re: FH Plugin debug window runs very slowly

Posted: 27 May 2022 09:31
by ColeValleyGirl
I have a small 'plugin test harness' project that includes a variety of relatively unusual data combinations to catch edge cases as well as more 'normal' data.

Re: FH Plugin debug window runs very slowly

Posted: 27 May 2022 10:00
by Talln
Thanks all...you're right of course re test data...if I was working I'd be the first to get it done properly, but dev is now a pastime so why let professionalism get in the way ! ;-)

But I will implement a Named List feature today!

Cheers

Re: FH Plugin debug window runs very slowly

Posted: 27 May 2022 10:38
by tatewise
If you were hoping that a Named List would hold the test case subset then that may not work well.
Unfortunately, there is no method via the FH plugin API to directly access records in a Named List.
You will have to loop through every record and use if fhCallBuiltInFunction( "IsInList", ptrRec, "ListName" ) then ...