Home > Music, Social issues, Tech > Various things

Various things

Man, with all this Explosions in the Sky, Do Make Say Think, and Mogwai I’ve been listening to I had forgotten how good Godspeed You! Black Emperor’s Yanqui U.X.O is. How can you not like a band so pretentious they moved the exclamation point at the end of their name to a random place in the middle?

Python regexes are slow. Really slow. Actually, it’s kind of odd. Doing some comparisons with Perl on my box at home, there’s not a huge difference. On one of our boxes at work, holy hell. I forget the actual numbers. A system call to grep cuts the processing time from a few minutes to a few seconds for the script I was writing.

You know, I can sort of understand laws against drugs, prostitution, and some other “crimes” involving consenting adults. Laws on gambling? Aside from industry regulations regarding fraud, I don’t get it. I mean, really. Gambling? I’m a bit mystified as to how that became taboo to the point of some states having laws against it.

Categories: Music, Social issues, Tech
  1. rob
    January 18, 2007 at 2:24 am

    What version of Python are you running at work? Are you compiling your regexes before using them? Python should be slower than Perl at regexes, sure, but it’s not dog-slow.

    You could always try profiling your script and seeing what’s taking the longest.

    # in script:
    import profile
    profile.run('', '')

    # then in interpreter:
    import pstats
    p = pstats.Stats('')


    # nicer output

  2. January 18, 2007 at 6:49 pm

    2.5 and yes, I’m compiling them. I did profile it and found that it was spending the vast majority of its time in the regex search method. The Perl and Python scripts were different enough that other factors probably contributed to the difference, but it was still really surprising to me.

  3. January 18, 2007 at 10:29 pm

    If you like later GY!BE, listen to The Ascent of Everest’s How Lonely Sits the City!

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: