ScriptFu late bind symbols to PDB procedures (for better startup speed)
Summary
Change ScriptFu to late bind symbols to one foreign function that calls PDB procedures, instead of defining symbols for all the many PDB procedures at ScriptFu initialization. This slightly speeds the startup of the ScriptFu extension, and thus the startup of GIMP. It probably slightly slows down the execution of scripts.
Status
It seems to work. See the MR, where there is more technical discussion.
Benefits and drawbacks
The main benefit is startup speed. Preliminary results are that the start time of ScriptFu extension is reduced from about half a second to a few tenths of seconds.
Since the GIMP app startup waits for the ScriptFu extension, the startup of the GIMP app is also reduced. There might be other ways to make GIMP startup not depend on ScriptFu startup.
Reduced startup speed is also important if you want to make ScriptFu into a interpreter like the other GIMP interpreters, that is not a resident extension and that starts and terminates on each invocation. If ScriptFu becomes a regular interpreter instead of an extension, a user of sketchy scripts would not need to restart GIMP when ScriptFu crashes. There could be other ways to shield users from crashing ScriptFu (just poll for it and restart it automatically.)
A drawback is slower script execution. The enhancement works a little more to interpret Scheme language. This is hardly noticeable because the performance of most scripts is dominated by GIMP execution of image algorithms.