Archive for February, 2009
Sourceforge reintroduces persistent login cookies
Sourceforge has reintroduced persistent login cookies. Here’s the bug request I submitted about this, a long time ago.
The thing is, I don’t really care much anymore. I’ve moved my open-source projects off Sourceforge onto Google Code. I am about 10x more productive there.
This lesson can be applied to pretty much everything on the web these days. Make it even the slightest bit hard to use your service, and people will use what’s easy instead. (Sourceforge’s user interface is more than slightly hard to use.)
The New York Times is the same way for me. They want me to log in to read the news stories. They say it’s free, and I say ok, then why do I need an account? Forget it.
Am I selfish? Do I want something for nothing? Am I lazy and impatient beyond imagining? Yes.
Am I typical? Yes.
Using Devel::FastProf to find slow Perl code
I’ve been profiling a Perl program recently with Devel::FastProf, and I had a little bit of a hard time finding one of my hot spots. I had a construct like the following:
if ( $condition_one ) {
# some code
}
elsif ( $other_condition ) {
# code
}
elsif ( my (@temp) = $text =~ m/(complex) (regex)/g ) {
# some other code
}
elsif {
# and so on
}
Devel::FastProf showed me that my hot spot in the code was the very first line. I could not understand why. I tried a few different things — always the same result.
Then it hit me. The way I write the code and what the Perl compiler turns it into aren’t the same things at all. Ever tried to debug an if/elsif/elsif statement in Perl’s debugger? You get to step up to the first line, but then immediately afterwards you drop into the case that matched — you don’t get to step over each condition check in turn.
Perl treats them all as one statement. And my hot spot was really the third conditional check. I fixed it by replacing that with a simple regular expression and doing the complex parsing inside the block.
An invitation to PostgreSQL community members
I’m not sure this has been publicized much in the PostgreSQL world yet, but the Percona Performance Conference is not a MySQL-centric event. We’re hoping for good sessions on PostgreSQL and lots of other topics. So this is an invitation — come attend, and submit sessions.
A few words about marketing. The event is free, and even though it’s stamped with Percona’s name and under Percona’s control, it is a technical event. If you want to present, you will be welcome to bring some marketing materials for your company. We’ll have something like a table for pamphlets and books. If you would like to present on a commercial product, it’s fine; and it’s okay to mention what you do or what your company does — we’re not trying to cramp anyone, but we’re looking for technical sessions. We’ll be doing the same thing. We’re renting a booth in the expo hall to do marketing.
We hope this will be an opportunity to get together and learn and teach; there isn’t really a PostgreSQL event on the west coast until later this year. I’ve made phone calls and sent emails to a lot of my PostgreSQL friends, but I’m sure I’m missing someone — I just went through my business card collection. Spread the word!




