Concerns about performance w/Python, Pysco on Pentiums
Peter Hansen
peter at engcorp.com
Wed Mar 5 21:47:10 EST 2003
Gerhard Häring wrote:
>
> Peter Hansen <peter at engcorp.com> wrote:
> > [hardware simulator in Python]
> > More interesting to me, however, is the poor relative performance
> > of the faster machines. I can believe the P3 866 should be about
> > 5.5+ times faster than the old P266, but the P4 is only 35%
> > faster than it!
>
> It may well be that the real bottleneck of your simulator is memory access
> and not CPU. In this case you could try rewriting your Python code so that
> it uses continuous memory blocks. If for example you use lists for
> simulating the RAM, you could try to use the buffer module instead.
That's an interesting thought, although I might run into trouble with
the second idea. Buffer can only handle primitives all the same,
whereas the main reason to simulate memory with a list is that you
can then stick "memory-like" objects in it to simulate the special
registers of the hardware, such as having a UART register which then
interfaces to the serial port on the PC, or a timer register which
can trigger simulated interrupts at the appropriate time.
> Still this sounds like memory is the bottleneck ... You could try to look
> at the cache misses for your process, if that is at all possible.
Not knowing that much about Linux I'd be at a loss to do this on my
own. Any suggestions for where to look? (And I'm just going to
assume outright that it's infeasible under Win98. :-)
Thanks for the thought. I'll see what I can think of to prove or
disprove it.
-Peter
More information about the Python-list
mailing list