Category archives: Snaking
Discussions of programming, particularly of programming Python
PyPy hits 3x speed (or 1/12th, or 2.5x depending on the sign-post)
Written by
on
in
Snaking.
Another day playing with PyPy. First up was a pleasant surprise in that the 2x slowdown reduced with the currently nightly build[1], bringing performance up from 40,000cps to ~60,000cps.
After that, applied a micro-optimization that got me about a 6% speedup; I eliminated the use of a state "struct object" (object that just used regular ...
First tempting micro-successes with PyPy
Written by
on
in
Snaking.
I spent much of Tuesday working on getting PyPy running SimpleParse. I have to be honest, I was kinda hoping I'd install PyPy and "pow" I'd have a 20x faster parser engine. It didn't quite work out that way, it was actually 2x slower, with no real explanation of why. My poor laptop hasn't been ...
Forgot how big SimpleParse is...
Written by
on
in
Snaking.
At this point I have almost all of SimpleParse converted to pure-python operation. It is still using the Python call-stack for its state storage, just for convenience in coding. That makes it approximately equivalent to the version using "stock" mxTextTools wrt blowing up on recursive grammars (the TextTools fork SimpleParse bundles doesn't blow up on ...
Bellorussian Py3D.py
Written by
on
in
Snaking.
Paul Bukhovko has translated the Python 3D Software page into Bellorussian, so if you're a 3D Pythonista who prefers your summaries in Bellorussian, head on over.
A small enough task to explore PyPy without getting lost
Written by
on
in
Snaking.
Those who have spoken with me on the topic will recall that I'm rather enthused about PyPy's potential. But every time I've sat down to play with it I've run into a bit of a "small steps" issue... i.e. what small project do I have where I don't need Numpy (which excludes most of my ...
Little bit of OpenGL hacking this afternoon
Written by
on
in
Snaking.
Managed to find and fix a few small bugs in PyOpenGL. Also did some minor Python 3.x compatibility work. BTW, Python 3.x advocates: low-scored reviews on PyPI with snarky comments are not a huge motivator. Actually they are a pretty strong de-motivator. I was so tempted to just change the categorization to something equally snarky ...
I was like, all, let's do uPNP too... then I was like, meh
Written by
on
in
Snaking.
So, having worked with mDNS/Zeroconf a bit, I thought I'd take a quick look at uPNP, particularly the IGD device type. IGD here is "Internet Gateway Device", i.e. your router. There are approximately two things you want to be able to access from generic software on a router, your external IP address (so you can ...
mDNS is kinda fun
Written by
on
in
Snaking.
I've been writing mDNS and uPNP code this past week. It's kinda fun. I've been using a hacked-up version of pyzeroconf which breaks out the multicast, dns and mdns stuff so that multicast-but-not-zeroconf code can use the same code paths as the zeroconf code. Sample code for doing a basic multi-cast but not mDNS operation ...
Flex Devs, KISS, please, for the Love of the FSM
Written by
on
in
Snaking.
I have been writing some acceptance tests for a Flex application in Selenium using Nose, and VirtualBox. To do so, I had to fix quite a few bugs in the Selenium Flex API. Are all Flex devs over-engineers? The SFAPI had a scary series of interacting methods, a helper class, multiple pieces of shared state ...
All those little spots where you use strings...
Written by
on
in
Snaking.
x.split( '.' )Is an idiom that shows up all over the place, particularly in list comprehensions. Run your code through 2to3 and it fails when x is a str (bytes) object, as 3.x thinks the '.' is unicode. It fails with a rather cryptic
TypeError: Type str doesn't support the buffer API error as ...