Calling external functions in a native library package directly, is rather slow.
Running them via e. g. ::routine dropfuncs external 'library rexxutil SysDropFuncs
is much faster, as the search order of ::routine
functions is before macrospace pre-order.
It would be nice, if something was done to make all loaded library package functions un faster.
Anonymous
From: Rick McGuire object.rexx@gmail.com
Date: Tue, Mar 28, 2017 at 9:51 PM
Subject: Re: [Oorexx-devel] Calling native library code is slow
Hmmm, had an idea that could work. Right now, the ::routine external definition is faster because this is handled by adding a routine object to the package routines list. Since that is checked first, the lookup is very fast. Right now, routines defined in loaded libraries are located at the same stage as routines registered with the rxapi server. We could give those libraries a promotion in the search order fairly easily.
The changes required:
1) split PackageManager::invokeExternalFunction into two methods, invokeLibraryFunction and invokeRegisteredFunction.
2) In the SystemInterpreter::invokeExternalFunction methods. replace the call to SystermInterpreter::invokeExternalFunction with a call to invokeRegisteredFunction.
3) add a call to invokeLibraryFunction to RexxActivation::externalCall before the checks to the exits.
The search order for external functions will need updating in the docs as well.
Rick
Is there any possible side-effect to existing programs if the search order is changed?
Committing Rick's code from [patches:#204] Performance enhancement for ::routine calls
Revision [r11374]
Related
Commit: [r11374]
Patches:
#204