Ted Leung on the air
Ted Leung on the air: Open Source, Java, Python, and ...
Ted Leung on the air: Open Source, Java, Python, and ...
Sun, 16 Mar 2003
Fast Python
Today I read Skip Montanaro's
Python Performance Tips. This really helped me get an idea of the things that impact performance in Python programs.
It seems that both the languages that I use regularly, Java and Python have issues with string concatenation. In both languages, the thing that seems to be the obvious way to concatenate strings is also the low performance way. There's so much string handling going on in the world that I just don't understand why strings are so broken this way. Seems like there hasn't been a lot of attention paid to strings, and probably only C++ programmers are aware of Hans J. Boehm's work on Ropes.
I was happy to find that for loops are not as fast as using map, but disappointed because list comprehensions are syntactic sugar for for loops and therefore also slow.
I was also surprised to find out that import statements are executed, although I guess if I had thought about it for a minute I would have realized that. Same for using calls like
[23:34] |
[computers/programming/python] |
# |
TB |
F |
G |
0 Comments |
string.upper
.
At least I'm on the way to building a mental model of performance for Python.
Haystack and Adenine (python + RDF)
It turns out that Haystack is implemented in Adenine, a python like language that knows how to deal with RDF. In fact, it appears that RDF can be used to add metadata to the Adenine bytecodes (I'm not totally clear on this because the document that I read was not quite finished). Adenine also knows how to talk to Java (It's implemented in Java -- so its like an RDF-aware Jython+++). Haystack's UI framework is implemented in Adenine, and appears to use RDF for describing widgets (The framework document is long, and I just paged through it quickly -- I'll sit down for a thorough read later this week).
I'm really curious to see the Haystack developer release when it comes out. Maybe by the end of April we'll see both a Haystack and Chandler developer release.
[22:53] |
[computers/open_source/osaf/chandler] |
# |
TB |
F |
G |
1 Comments |
pyblosxom pingbacks
I've implemented pingbacks for PyBlosxom:
To see it in action, the pingback url for my dev blog is
http://64.38.174.108/blog/xmlrpc
The method is called pingback.ping, just as in the pingback spec.
The code is now up at http://www.sauria.com/~twl/code/python/pyblosxom
Look at:
[00:19] |
[computers/internet/weblogs/pyblosxom] |
# |
TB |
F |
G |
0 Comments |
pyblosxom/sendpingback.py
to send a pingbackpyblosxom/libs/xmlrpcplugins/pingback.py
for the implementation