March 11, 2009 § Leave a comment
March has been a good month for PyPy project. In this post, their JIT is 20x faster than CPython. The code is below:
i = 0
while i < 10000000:
i = i + 1
From the blog post(s), the JIT is generated via tracing the code’s bytecode. The post said that most of their crashes happened because of unsupported operator on the assembler back-end.
Since, PyPy project allows multiple back-ends (well… that’s the whole point), having more assembly developers working on the JIT would be a great thing to realize its speed potential.
(I know, I know, the point of PyPy project is not just for speed, but there are a lot of people who are enthusiastic for this reason)
So, if you know friends who know assembly, spread the words…
March 9, 2009 § Leave a comment
More and more KVDB projects are entering the scene, this time is Redis.
Why redis is cool? Writes to disk is perform periodically as opposed to immediate. Perfect for applications that are cache-heavy.
It boasted 100,000+ writes/sec. That’s pretty cool, the fastest benchmark I’ve seen so far. But don’t jump on it for mission critical application, yet. They just got started on implementing the replication. Just wait for a bit, from browsing the source, codes are checking in daily.
March 6, 2009 § Leave a comment
Guido is kind enough to share some of his design decisions in this blog.
February 24, 2009 § Leave a comment
A coder called Tav submitted this challenge. Enjoy!
His module was created with the intent to restrict execution to local filesystem.
January 8, 2009 § Leave a comment
This is one old wiki post that’s continually being updated. There’s not much value in the posting other than entertainment.
December 31, 2008 § 3 Comments
When using Django model’s ImageField, you need to have Python Image Library installed.
If your machine is Linux, easy job. Simply do the typical: wget, configure, make, and make install.
If your machine is Intel OS X… not so easy.
The configure script assumes that the OS X is using PPC architecture, thus make install would fail.
Luckily, folks at pythonmac.org provided a nice installer for PIL. You can get those here. It works for both Tiger and Leopard.
December 18, 2008 § 2 Comments
It’s called Super Simple Message System.
For multiple obvious reasons, it will not scale to withstand the hailstorm of internet users.
What does it do:
It allows server-side machines to send string messages to each other.
Why did I do it:
To illustrate various concepts like:
- Web service
- Messaging system
- How to build a complete application in 4 hours using Python.
- What does it feel (for me) to host an open source project.
December 2, 2008 § 2 Comments
I really miss Ruby’s Time.now.to_i, too bad Python does not have something as convenient.
So I created one:
import datetime import time class TimeUtil(): @classmethod def to_i(cls, t=None): if t is None: t = datetime.datetime.utcnow() return time.mktime(t.timetuple())
November 2, 2008 § 1 Comment
In short, Cython generates C code by reading your Python code.
Cython is yet another solution to the question: “Dynamic languages (which include Python) are slow”. Previously there are already multiple solutions:
Basic tutorials on Cython out there:
- Using Python to calculate great_circle circumference, then optimize the same function with Cython
- How to install Cython, then use it to optimize Python function that calculates Primes
I haven’t use Cython or any other optimizer yet since it’s too premature to do so. This post is a reminder for myself, when the time is right, I will have to choose one of them.
When it comes to Python profiler, I am looking at hotshot.
October 29, 2008 § Leave a comment
Yes, my blog is WordPress service, which is PHP shop. But soon I will have a need to install a blog engine on my own. I would rather have the engine written in Python.
The thing is, there are only a few of them out on the internet:
One of them is PyBloxsom. Such a difficult name to remember. It is file based, a bit different than typical setup. It runs as CGI application or WSGI application or maybe mod_python.
Another one is Django Blog Engine, using SQLite and Django framework. Seems reasonable…
On the other side of my brain, I’d rather have an even simpler blog engine on top of cherrypy and mysql.
So, I up for 2 choices write my own, or Django Blog Engine since PyBloxsom is a bit too funky. If readers know a simple blog engine written on top of cherrypy and mysql, please tell me because I’m not looking forward to writing a blog engine.