[NTLK] Einstein w/partially precompiled ROM

Vladislav Korotnev vladkorotnev at gmail.com
Tue Dec 23 09:00:50 EST 2014

Pure awesomeness! Great job


On Tue, Dec 23, 2014 at 8:23 AM, Matthias Melcher <mm at matthiasm.com>

> Hi Folks,
> As some of you have read, I am currently trying to precompile parts of the Newton ROM into C code which is then translated into machine code at Einstein's compile time instead of run time, as it is done right now.
> I managed to precompile every function that is used by NewtTest 1.1 loop counter and a bunch more - about 10% of the entire OS.
> Here are the results:
> Precompiled:
> 	Debug mode:	12525 iterations
> 	Optimized:	38000 iterations
> JIT Generic:
> 	Debug mode:	 9300 iterations
> 	Optimized:	26700 iterations
> So the speed increase is 35% in debug mode, and 42% when compiling with full optimization (all tested on a MacBook Pro 2.6GHz Intel i7). This is pretty much what I expected.
> If we assume that half the time in emulation is put into the MMU emulation, and half the time into CPU emulation (1), then precompiling doubles the speed of the CPU emulation. 
> I have hand-optimized a few functions for testing. It is possible to remove pretty much all stack operations, reducing the number of MMU emulation calls by maybe 20 to 30%, gaining again more speed.
> Summary: by precompiling the entire ROM, we will have a 40% speed gain (or a 30% reduction of battery use, depending on which way you look at it). Performance can be further improved by optimizing memory access. Optimal performance can be achieved by eliminating the use of the MMU and by hand-coding a new NewtonOS.
>  Matthias
> 1) it's difficult to prove this, but it feels like a good approximation)
> ----------------------------------------------------------------------
> The NewtonTalk Mailing List   http://newtontalk.net/
> The Official Newton FAQ       http://splorp.com/newton/faq/
> The Newton Glossary           http://splorp.com/newton/glossary/

More information about the NewtonTalk mailing list