shift or die

security. photography. foobar.

German Perl Workshop 9 — the rest of day 1

After covering the regular expression talk in much detail, here are some more short notes and comments about the rest of the first day of the German Perl Workshop 9.

Max Maischein talks about Office Automation using Perl. As I am luckily not an active user of any office product whatsoever, this is only of little interest to me. But from what Max shows, it looks like if I ever have to use Office, this might be the power user way to do it. The trick basically consists of recording the actions using the macro recorder, staring at the VBA output and then converting it to appropriate Perl statements for Win32::OLE.

Simon Dassow talks about Catalyst, a well-known web application framework for Perl. He is the OpenBSD maintainer for it, so OpenBSD user can have an easily installation using the ports system. Apparently, it works comparatively easy under Debian testing, too. Having installed Catalyst for Angerwhale, it looks like something I might want to have a look at, too. Unluckily, Simon shows little code, so I have no idea how the code one has to write compares to Jifty. But as the example application he shows is available on the CD, this will definitely change soo. Another interesting information is that some people from the Catalyst community are apparently writing a book about it, which might be helpful, too.

Alvar Freude talks about performance optimization (slides). The best performance optimizations are done by actually thinking about the problem and finding a clever way to solve it. If that does not help, trying out different variants using Benchmark (or even just Time::HiRes for a quick test) is the way to go. And then there are of course the various profiling modules such as Devel::DProf, Devel::Profiler and Dvel::SmallProf (although I must say that I have quickly tried running the first two on OpenXPKI and have failed to get them to work). Compiling perl using -Dusemymalloc apparently gives about 10% more speed, but has the disadvantage that memory allocated by perl will only be reused by perl and not by the rest of the system. Surprisingly enough, running several regular expressions for substition over some text is faster than the »clever« of doing all of it inside one larger /e regular expression. This provides a nice example for the proposed strategy of testing which variant is actually faster. Other things that are slow are IO, XML and many method calls when using object oriented Perl (I guess OpenXPKI is a bit guilty of the latter). Alvar goes on to talk about database optimization which he has done some testing on using both MySQL and PostgreSQL. Using bind columns, prepared statements and fetchrow_hashref is apparently the by far fastest way to do it. He also proposes to do a lot of the more complicated things inside the database using functions, triggers and views, which is IMHO something that is nice and feasible when you only have to maintain one database driver, but is a lot of work if you want to support more then one database for your project. Alvar says that a webpage should be available within 10ms and that it should never take more than 100ms, which unluckily is something that OpenXPKI is far away from. The more often the pages are displayed, the faster they should be available and one should also test with a full database — both are things that we still need to consider for OpenXPKI. If optimization does not help anymore, there of course is the possibility to add more hardware and balancing the application, for example using Perlbal. Caching pages using mod_cache or memcached seems like an interesting option, too.

Michael Kröll talks about the use of WebDAV in the XIMS Content Management System. As WebDAV is only a superset of HTTP, it is pretty easy to implement and provides nice integration for non-technical users.

Stefan Fischerländer of Neomo talks about using Perl as a backend system for a web search engine. Neomo has a test web crawler that has indexed about 175 million german language documents to show off their technology. They use Perl for nearly everything as »it waits for the hard disk at the same speed as C« and »life's too short for static typing«. What surprised me is that they don't actually use a database for the crawled data but have text files or Berkeley DB files and their own index files, which they found to be faster.

As the last talk of the day, Marc Lehmann talks about Crossfire+, a MORPG for which both client and server have been implemented in Perl. They use SDL and OpenGL even though their world is strictly 2D, but this seemed to be the most portable way to do fast 2D graphics.