published on 11.08.2007 16:32.

25 german startups, and their technology choices

jetzt.de (the “youth” magazine of the süddeutsche zeitung) gives an interesting overview of 25 current german startups, asking every one of them around a dozen questions.

greenmiles.de

i found the greenmiles.de idea particularly interesting: you enter your planned trip and transportation type, then they calculate how much co2 is produced. you can then donate an appropriate amount of money to climate conservation programs, allowing you trip to be climate neutral. of course very rough, but nevertheless interesting feedback on how much co2 one of us produces in his day to day life. for example, one round-trip flight hamburg-munich produces 9m³ of co2, which equals a cost of 8 euros.

german startup technology choices

i was curious which technologies these startups would consider best for their success, so i looked at the programming languages and frameworks they used. here are the results:

60% php
16% ruby (= ruby on rails)
16% java
4% asp.net
4% (project offline)

a couple of observations:

php & java have been at the availability of web developers since at least 1999 (that’s when i started) and ruby on rails had it’s 1.0 release in december 2005. so i can only say: go rails! :-)

so let’s say konichiwa to these ruby on rails projects:

looking at php

of course with 60%, php is the most important language by far. it’s the technology one needs least development experience for, and it allows fast results; therefore very appealing. working with less experienced developers however also means things can go really bad down the road – remember the studivz scalability and security issues, for example. and still not all of the startups seem to do their php development in a professional way. some use a CMS (typo3) as a base for their site, others still run php version 4, which has been replaced by php5 three years ago and is now discontinued.

there is only rails

the java and php projects use a variety of frameworks, but in the ruby projects – there is only rails. that’s good – a ruby web developer will almost certainly know how to work with rails. a php developer will more than likely not know how to work with your framework, since there are so many open source php frameworks out there, and still many people roll their own one.

on a side note, only one startup runs on microsoft technology …

i figured out what a site runs by looking at their webserver’s responses (server type, cookie name) and the generated html. if in doubt i checked their tech jobs postings, too. for the technically inclined, here’s the full list:

  • dealjaeger.de: java
  • spickmich.de: php
  • cellity.com: java (jboss)
  • autoaid.de: php (symfony) AND/OR python
  • hitflip.de: php
  • verwandt.de: php
  • amiando.de: java
  • dawanda.de: ruby on rails (/w mongrel server)
  • hiogi.de: php
  • zeitkapsel.de: php
  • wazap.de: java
  • schutzgeld.de: php (typo3)
  • frazr.de: php
  • rankaholics.de: php
  • sevenload: php
  • imedo.de: ruby on rails (/w mongrel server)
  • globalzoo.de: php
  • greenmiles.de: php (typo3, still php4!)
  • jajah.com: asp.net
  • mitbringzentrale.de – (offline)
  • mymuesli.de: php (still php4!)
  • qype.de: ruby on rails (/w lighttpd server)
  • spielerkabine.de: ruby on rails (/w lighttpd server)
  • edelight.de: php
  • studivz.de: php

Posted in , ,  | no comments

published on 27.03.2007 08:06.

PHP: a quick SimpleXML benchmark

update: needs work to become comparable with the ruby benchmark posted earlier.

as an update to the ruby xml performance test, some info for PHPs standard way of parsing XML, SimpleXML. since it uses libxml2 internally, the results are more comparable to ruby’s libxml2 parser, although not identical … (i don’t yet understand where the factor 10 difference in xpath comes from).

loading an xml file

file size ms
10KB 0.71
100KB 5.88
1.6MB 120.97

simple xpath expression

file size ms
10KB 0.75
100KB 6.39
1.6MB 79.52

the test code

<?php

function benchmark($function)
{
   $start = microtime(true);
   for ($i=0; $i<10; $i++) {
      // execute the anonymous function ("yield")
      $function();
   }
   echo ((microtime(true) - $start) / 10) * 1000;
   echo "\n";
} 

// put file into filesystem cache (hope this works)
file_get_contents('products.xml');
/**
 * info: using create_function does not change performance 
 * (in comparison with executing the code in a more traditional php way)
 */

// loading xml into an object
benchmark(
   create_function(
      // function arguments as string
      '',
      // method body as string
      '$doc = simplexml_load_file("products.xml");'
   )  
); 

benchmark(
   create_function(
      // function arguments as string
      '',
      // method body as string
      '$doc = simplexml_load_file("products.xml");
       foreach ($doc->xpath("//articles/article/shortdesc") as $node) {
          //echo $node;
       }'
   )
);

?>

Posted in ,  | Tags , , ,  | no comments

published on 27.03.2007 07:43.

extending PHP's SimpleXML

PHP’s XML workhorse, SimpleXML can be extended. you can supply a class of your own for PHP to wrap all XML nodes instead of the default SimpleXMLElement. do this by passing the desired class name as a string to the simplexml_load_(file|string) methods:

<?php

class MySimpleXMLElement extends SimpleXMLElement
{     
   // extending parent method
   public function xpath($path)
   {  
      echo "evaluating the following xpath expression: $path\n";
      $result = parent::xpath($path);
      echo "found " . sizeof($result) . " nodes";
      return $result;
   }
}

$doc = simplexml_load_file('products.xml', 'MySimpleXMLElement');
// calling an extended method
$nodes = $doc->xpath('//articles/article/shortdesc');
echo "\n";

// calling a parent method
echo $doc->root->getName();
echo "\n";

?>

i didn’t poke around in the internals of the parent class too much, no idea how well that would. on the other hand, in many cases it might be a better solution to delegate to SimpleXML instead of inheriting and extending from it.

Posted in ,  | Tags , ,  | no comments

published on 18.03.2007 11:20.

ruby: performance comparison of rexml and libxml

update: here’s the same for PHP’s XML Parser.

a quick comparison of the two libraries available for processing XML in ruby shows dramatic performance differences.

am i missing something, is there a fundamental flaw in the test? of course REXML is pure ruby, while libxml is C; but can the difference really be so huge?

loading an xml file

file size libxml REXML factor
10KB 0,83 39,17 47,0
100KB 6,67 306,56 46,0
1.6MB 71,88 3954,21 55,0

simple xpath expression

file size libxml REXML factor
10KB 0,12 124,68 1004,7
100KB 0,67 678,11 1016,8
1.6MB 6,21 22578,18 3633,6

the test code

def benchmark
   start = Time.new.to_f
   10.times { yield }
   puts ((Time.new.to_f - start) / 10) * 1000
end

doc = nil

# exclude the effect of filesystem caching (makes sense?)
File.read('products.xml')

#
# libxml
#
require 'rubygems'
require 'xml/libxml'

benchmark do
   doc = XML::Document.file("products.xml")
end

benchmark do
   doc.find('//articles/article/shortdesc').each do |node|
      #puts node.content
   end
end

#
# rexml
#
require "rexml/document"

benchmark do
   doc = REXML::Document.new File.read("products.xml")
end

benchmark do
   doc.elements.each("//articles/article/shortdesc") do |node| 
      #puts node.text
   end
end

Posted in , ,  | Tags , , , ,  | no comments

published on 03.10.2005 00:00.

Flickr API fun

hey! since i migrated this page from php to the ruby-based weblog typo, these images currently don't update.

by *sam by konaboy by rougerouge by flickrwegian
by akiruna by _rebekka by roweun by SophieMuc

A random selection of my flickr favorites

all of these great photos have been taken by the flickr contributors, not by me. hover over an image to see the name of the photographer; click the image to see the full image in flickr.

kudos to rasmus for developing & donating the php flickrAPI. Oh, and the programming language, of course :-)

you can download the source code here. enter your flickr api key and the secret, and you're ready to go. (note: i don't cache the favorites info, that would be a nice addition).

Posted in , ,