VM improvement: speeding up failing calls of functions in missing modules

Stephan Rudlof sr at evolgo.de
Fri Jan 28 05:31:12 UTC 2000


Dear VM-Hackers,

this changeset speeds up *failing* of external primitives whose module
is *missing*. It is not a [FIX] now, because I'm waiting for a reaction
of a man working at a Mac platform (I'm working at Linux) to have more
experiences.

I've made this, because I'm currently working at a seamless integration
of a LargeIntegers plugin and I want to have the possibility of
switching this plugin on/off just by moving or removing the
corresponding module. But failing of a primitive function located in a
missing module was very slow, so I had to work...

File in both changesets and compare old and new VM with:

| t arg |
arg _ 10000.
t _ Test new.
[1 to: arg do: [:div | t callNotExistentModule]] timeToRun.

Results for me:
 3204 3213 3206 "before"
 18 17 18	"after"
-> factor: 3204 / 18 = 178 !!!

The preamble of the attached changeset:

"Change Set:		VM_speedUpCallsOfMissingModules
Date:			28 January 2000
Author:			Stephan Rudlof

Speeds up *failing* of external primitives whose module is missing.

More exactly: If loading a function from an external module fails, a
check is made if this module exists at all: If not, then there won't be
another trial of loading functions from this module during the current
session.
This is necessary for seamlessly integration of plugins without the
drawback of a speed penalty if the plugin module cannot be reached for
whatever reason.

*** This changeset is not for beginners! ***
	You have to recompile the VM (using regenerated 'interp.c') to generate
a new squeak executable.

*** Please make a backup ***
	of your *.image and *.changes files, *before* you apply this changeset
and *before* you play with the new VM!

*** You have been warned! ***


Functionality:

Much time seems to be spent in
ioLoadExternalFunction:OfLength:FromModule:OfLength: which is called in
Interpreter>>primitiveExternalCall. This change sent introduces a
history of missed modules (currently three entries) to avoid calling
this function, if the corresponding module has been missed in a previous
call.
Checking if a module exists works by trying to load the 'setInterpreter'
function pointer, which should be there in every external module:
otherwise there is a problem!

Note: If you install a module *while* Squeak is running you should
restart Squeak to have an effect!"


Greetings,

Stephan
-- 
Stephan Rudlof (sr at evolgo.de)
   "Genius doesn't work on an assembly line basis.
    You can't simply say, 'Today I will be brilliant.'"
    -- Kirk, "The Ultimate Computer", stardate 4731.3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: VM_speedUpCallsOfMissingModules.5.cs
Type: application/octet-stream
Size: 13168 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20000128/c1f1ce3f/VM_speedUpCallsOfMissingModules.5.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Test.st
Type: application/octet-stream
Size: 1661 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20000128/c1f1ce3f/Test.obj


More information about the Squeak-dev mailing list