Menu

#688 Calling native library code is slow

5.0.0
closed
nobody
None
none
1
2023-01-01
2017-03-28
Erich
No

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.

Related

Patches: #204

Discussion

  • Erich

    Erich - 2017-03-28
    • status: unread --> accepted
    • assigned_to: Erich
    • Pending work items: none --> code+doc+test
     
  • Erich

    Erich - 2017-03-28

    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

     
  • LesK

    LesK - 2017-03-30

    Is there any possible side-effect to existing programs if the search order is changed?

     
  • Erich

    Erich - 2018-03-20
    • status: accepted --> pending
    • assigned_to: Erich --> nobody
    • Pending work items: code+doc+test --> none
     
  • Erich

    Erich - 2018-03-20

    Committing Rick's code from [patches:#204] Performance enhancement for ::routine calls
    Revision [r11374]

     

    Related

    Commit: [r11374]
    Patches: #204

  • Rony G. Flatscher

    • Status: pending --> closed
     

Anonymous
Anonymous

Add attachments
Cancel