Does importing of lots of functions costs much?

Q&A's, tips, howto's
Post Reply
HPW
Posts: 1377
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Does importing of lots of functions costs much?

Post by HPW »

When I import lots of functions does this costs much? (memory, cpu-load)

I have set up a loader-file for the pdf-lib with 304 functions.
Can I do this as default or must I pick only the current needed functions?
Or are the functions only some more symbols in the symbol-table?
Hans-Peter

HPW
Posts: 1377
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

After some tests I found only a little difference between 1 and all import-calls. It seems when the DLL is once loaded it doesn't change much. Memory load of the tk-frontend is more changing without a clear reason. But it seems not related to (import ..).
Hans-Peter

Lutz
Posts: 5282
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

The memory impact of an 'import' is minimal, just another symbol (32 bytes) and a cell to hold is (16 bytes). Calling overhead is very minimal too.

The memory load of the fronted is Tcl/Tk stuff and I don't know much about it. I know that the console window as it accumulates history consumes memory and gets slower. Click the 'clear-console' - button (the white paper sheet) once in a while or do a Ctrl-L.

Lutz

Post Reply