Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ukma!gatech!udel!new From: new@udel.EDU (Darren New) Newsgroups: comp.sys.amiga Subject: Re: shared/loaded libraries vs. resident Message-ID: <13712@louie.udel.EDU> Date: 21 Apr 89 20:55:28 GMT References: <13492@louie.udel.EDU> <8635@polya.Stanford.EDU> Sender: usenet@udel.EDU Reply-To: new@udel.EDU (Darren New) Organization: University of Delaware Lines: 26 In article <8635@polya.Stanford.EDU> gilham@polya.Stanford.EDU (Fred Gilham) writes: >The thing that concerns me about this is the performance hit. I read >somewhere that the cost of a library call is about 100us. You really >can't do anything about this, either; no optimization possible. The >cost of a procedure call should be smaller (right?). >-Fred Gilham On the Amiga, a procedure call would just be the one call instruction (assuming it was available at link time). On a shared library, you must first load the address of the library into A6, then call a word at some offset relative to A6. JSR -60(A6) ; or whatever the mnemonic is (Sorry, but it has been a while since I hit MC68000 assemblers.) At that address is (usually) stored a JMP.L to the actual code in the library. If you need optimization, you can probably keep A6 loaded with your lisp library. However, the overhead is nothing like an OS call on a Mac or PC where you need an interrupt on the call. The overhead is the time to load A6 (if any) and the extra jump instructin in the LibraryBase (plus the addressing mode overhead). If you have a manual handy, you can figure this out. You may wish to consider using inline code for things like CAR and CDR unless you detect NIL. Then jump to the library to handle it. Things like APPEND, MAPCAR, and so on could be library calls because of their relatively large size and long execution time. -- Darren