Tuesday 14 June 2011

CPython and PyPy: Small and Slow or Big and Fast

This is a heads up for all interested parties.

Presently, RPGMaker Trans is built on CPython, or the bog standard Python distribution. The reason for this is that when I was writing it, CPython was the only Python distribution which had all the Python 2.7 language features in it, and I wanted to use some of them.

Now the situation has changed; PyPy is now fully 2.7 compliant. Playing around with running the source through PyPy I can get substantial speedups - at least on my machine. Given that RPGMaker Trans is a slow program I'm thinking it may be a good idea to look at taking advantage of these speedups.

There's two slight problems I've got at the moment: the first is that PyPy doesn't support freezing - that is creating a special EXE file to run. There's a few ways around this - I'm leaning towards making a basic loader program that launches things. Heck, it might even be a good time to add a proper GUI and proper CLI if I go down that route. The second issue is download size; PyPy is a big binary - something like 27MB. So... perhaps a two version system (small download size but slow, and big download size but fast)?

And for reference, the RPGMaker XP code I'm working on does benefit substantially from PyPy - to the extent that it is a lot more usable. It really may be necessary to switch to a PyPy based system because of this.

If there are any thoughts, I'd be happy to hear them. In fact, I'd really welcome some feedback on where people stand on the small download size and slow or big download size and fast part!

3 comments:

  1. I got an encoding error while patching the game.
    What is the best way to get in touch with you or report a bug (currently I am not sure this is even a bug)?

    ReplyDelete
  2. An encoding error is most likely not a bug. Make sure that your patch files are encoded as UTF-8 (with or without a BOM). If that doesn't help, probably best to e-mail me with the offending patch files.

    ReplyDelete
  3. I e-mailed you the log.txt and *_patch.zip. It seems like rpgmaker trans does not like some unicode symbols in the translated section... Sorry just my uneducated opinion.

    BTW I do use UTF-8 to read and write to the file(s).

    ReplyDelete

Note: only a member of this blog may post a comment.