[Edu-sig] Properties use case
Douglas S. Blank
dblank at brynmawr.edu
Tue Mar 21 18:58:55 CET 2006
On Tue, 2006-03-21 at 11:57 -0500, Arthur wrote:
> I am of course thinking whether I have been knee-jerk in bringing Numeric
> into play as a fundamental tool for my application.
> Which I why I then move on to trying to get serious about gaining some
> profiling skills. Gain some intelligence about the trade-offs of doing the
> kind of simple linear algebra my application requires in pure Python, versus
> what I may gaining by the creepy calls to laplack.
> Judgment calls need to be made in the end, but I take them seriously enough
> to want them to be informed judgment calls.
I've been wrestling with these issues. I've built a Python robotics 2D
simulator in 99% Python, 1% Numeric. It works amazingly well: fast
enough and realistic enough to do the job. The robot can have sonar, IR,
and bumpers; lights, and light bulbs; a 2D camera with pan-zoom, and a
gripper to pick up things. The world has some simple physics (bump a
puck head-on and it will slide, with some friction).
Then I extended it to be a 3D simulator. Still, amazingly, fast enough
and realistic enough to do the job.
On the one hand, I like all of the source code to be accessible to the
student. We say that it is "Pythons all the way down". And that also
makes it portable. But on the other hand, it has to run fast enough.
We are able to do it all in Python, expect for the nitty gritty vision
and image processing code, which we use SWIG and C++.
I did some profiling, and was surprised at where some of the time was
spent. (This simulator is also controlled over sockets, so I had some
additional items to speed up). But, was able to refactor some, and get
some very substantial speedup, just in the Python portion. castRay() is
still the most expensive bit in Python.
I am also looking at IronPython for .NET and Mono, and am wondering how
much I can get in one layer (without going to C/C++) and how fast it
Here are some pictures:
> No conclusions as yet.
> Edu-sig mailing list
> Edu-sig at python.org
Douglas S. Blank Computer Science
Assistant Professor Bryn Mawr College
More information about the Edu-sig