Category Archives: Python

MemoryMapFile Convenience Class for Python

My obsession with mmap hasn’t died, but while Python’s mmap module is a wonderful low level library it’s a bit hard for a newcomer to use properly. I’ve started toying with a convenience wrapper class for mmap.mmap (at least the … Continue reading

Posted in Open Source, Python, Technology | Tagged | Leave a comment

Sharing Python data between processes using mmap

I’ve been toying with an idea of exposing statistics for a Python application via shared memory to keep the performance impact on the application as low as possible. The goal being an application could passively expose a number of metrics … Continue reading

Posted in GNU/Linux, Open Source, Python, Technology | Tagged , , , | 1 Comment

signalfd

This article covers signalfd, a system call only available on Linux. If anyone knows of an equivalent for OSX or BSDs,* please let me know. It’d be great to create a compatibility layer. Writing asynchronous IO code is fun; handling … Continue reading

Posted in GNU/Linux, Open Source, Python, Technology | 1 Comment

Deploying Python behind Nginx Talk Slides

I gave a talk on deploying Python WSGI apps behind nginx at the Portland Python User Group meeting on January 11th and finally got around to publishing the slides: schmingx. I should mention Jason Kirtland informed me after the meeting … Continue reading

Posted in GNU/Linux, Open Source, Python, Technology | Tagged , , , , | 4 Comments

Making Server-Side MongoDB Functions Less Awkward

I’ve recently switched my project at work to use MongoDB for the user database and a few other datasets. Currently I don’t use many JavaScript functions, but when I do I like to store them on the server so that … Continue reading

Posted in Open Source, Python, Technology | Tagged , , | 7 Comments

lxml vs. ElementTree

While lxml has some excellent benchmarks about the speed of lxml.etree vs. ElementTree, I wanted to run some tests that were as close as possible to my own use case (fairly simple multi-megabyte XML files). Here are the results of … Continue reading

Posted in Python, Technology | Tagged , , , | 8 Comments