* FH Plugin debug window runs very slowly

For users to report plugin bugs and request plugin enhancements; and for authors to test new/new versions of plugins, and to discuss plugin development (in the Programming Technicalities sub-forum). If you want advice on choosing or using a plugin, please ask in General Usage or an appropriate sub-forum.
Post Reply
User avatar
Talln
Gold
Posts: 18
Joined: 09 Feb 2021 17:15
Family Historian: V7
Location: London

FH Plugin debug window runs very slowly

Post 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
Paul Weaver, London
User avatar
Mark1834
Megastar
Posts: 2458
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: FH Plugin debug window runs very slowly

Post 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?
Mark Draper
User avatar
tatewise
Megastar
Posts: 28333
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: FH Plugin debug window runs very slowly

Post 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.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
ColeValleyGirl
Megastar
Posts: 5464
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: FH Plugin debug window runs very slowly

Post 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.
User avatar
Talln
Gold
Posts: 18
Joined: 09 Feb 2021 17:15
Family Historian: V7
Location: London

Re: FH Plugin debug window runs very slowly

Post 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
Paul Weaver, London
User avatar
tatewise
Megastar
Posts: 28333
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: FH Plugin debug window runs very slowly

Post 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 ...
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Post Reply