Callbacks from C into Squeak

dan mr.d.poon at
Thu Dec 21 11:33:31 UTC 2006

dan wrote:
> Interestingly, only half the total time is spent in the Smalltalk maths 
> calculation. I would like to work out how the time is split in our 
> existing code further, i.e. how much time is spend in the VSE callback 
> mechanism, and how much time is spent in Fortran doing the ODE 
> integration. That would tell me whether the main overhead is doing an 
> ODE integration, or whether providing sample points via a Smalltalk 
> callback is the main speed issue. Im not sure how to do that though...

Ive just done a benchmark, and the time taken to do a VSE callbak is 
0.05ms, which is not much faster than the process 2 process solution you 
suggested. Revising the figures using a non-debug DLL..

The total time spent in Smalltalk is 0.2ms, split into 1/3 performing 
the callback, and 2/3 doing the calculation.

The total time spent in Fortran is 0.1ms.

We spend twice as much time in Smalltalk as we do in Fortran. Moving 
everything into Fortran would at maximum tripple the runtime speed, 
which is not a great return on investment.

Moving the ODE solver from Fortran into a high level language like 
Matlab or Smalltalk would kill performance. So, the current solution 
sounds like the right architecture.


More information about the Squeak-dev mailing list