Alexa Eröffnung

Gestern war die Eröffnung des hässlichsten berliner Einkaufszentrums. Etwa hunder »Aktivisten« nahmen dies zum Anlass die kaufwütige Masse mit Sprüchen wie »KAUFEN KAUFEN KAUFEN!«, »WIR SIND HIER ZUM INVESTIER’N« und »Spaß ist Geil!«, anzufeuern. Musik wurde auch mitgebracht und das Alexa mit angenehmer elektrischer Musik beschallt. War alles ganz lustig, vor allem die gestörten Gesichter der Schnäppchenjäger.

Echt – da sind 5000 Leute um Mitternacht in diesen Mediamarkt gerannt um günstigen Elektroschrott zu kaufen – wirklich nicht zu glauben.

Schaut eucht das mal an: Alexa – im Kaufrausch

Und hier noch ein youtube video: YouTube – Eröffnung Media Markt Alexa Berlin

Gedruckt gibts auch was dazu: SHOPPING-CENTER-ERÖFFNUNG IN BERLIN – Nacht der Preiskämpfe

Der Wahnsinn in Tüten.

Canon 40D Arrived

Finally I got my own DSLR camera. It’s the new Canon 40D. More photos are about to come. Brace for impact!

Canon 40D

Migrate from MySQL 4.0 to MySQL 5.0

I just tried to migrate an old MySQL 4.0 installation to MySQL 5.0. Most of the dumps worked smooth but there was a MediaWiki dump which raised the following error:

ERROR 1071 (42000) at line 66: Specified key was too long; max key length is 1000 bytes

On this page is described what the error means:

Basically your new 5.0 DB defaults to utf-8 encoding. Type STATUS; in your mysql shell to find out. Your old dump is most likely latin1 encoded and there is a problem when you import it and your index keys are longer than 1000 byte. This is because MySQL 5.0 uses 3 bytes for every character.

The solution to this is that you edit /etc/my.cnf and insert /set the following lines:


[server]
default-character-set=latin1
[client]
default-character-set=latin1

Canon 40D officially announced

Finally! Read the first extensive preview here: http://www.dpreview.com/news/0708/07082010canoneos40d.asp

Hope they post a review pretty soon as well.

Ruby faster than Python and Perl!

When Pavel microbenchmarked every language he came across it turned out as expected, Ruby was the slowest language in all three micro tests. It was really embarrassing.

I was curious if this was about to change in future versions of Ruby so I checked out the current Ruby 1.9 version from their svn repository

svn co http://svn.ruby-lang.org/repos/ruby/trunk ruby

After compiling I ran Pavels microbenchmarks with the current stable Ruby 1.8.6, with the SVN version 1.9, Python 2.4 and Perl 5.8.8. Here are the results. I ran every Benchmark three times:

Ruby 1.8.6


$ ruby ~/Desktop/simple-bench.rb
Pavel's trivial ruby benchmark V.0.1
1000000 x {i+=1} took 0.243 sec. (4.114 mio. per sec)
2000000 x {i = my_add(i, 1)} took 0.940 sec. (2.128 mio. per sec)
50000 x {i = fullMatMult(a, b)} took 2.608 sec. (19172.294 per sec)

$ ruby ~/Desktop/simple-bench.rb
Pavel's trivial ruby benchmark V.0.1
1000000 x {i+=1} took 0.240 sec. (4.175 mio. per sec)
2000000 x {i = my_add(i, 1)} took 0.941 sec. (2.126 mio. per sec)
50000 x {i = fullMatMult(a, b)} took 2.611 sec. (19149.538 per sec)

$ ruby ~/Desktop/simple-bench.rb
Pavel's trivial ruby benchmark V.0.1
1000000 x {i+=1} took 0.242 sec. (4.135 mio. per sec)
2000000 x {i = my_add(i, 1)} took 0.943 sec. (2.122 mio. per sec)
50000 x {i = fullMatMult(a, b)} took 2.626 sec. (19038.328 per sec)

Ruby 1.9


$ /usr/local/bin/ruby ~/Desktop/simple-bench.rb
Pavel's trivial ruby benchmark V.0.1
1000000 x {i+=1} took 0.142 sec. (7.040 mio. per sec)
2000000 x {i = my_add(i, 1)} took 0.409 sec. (4.893 mio. per sec)
50000 x {i = fullMatMult(a, b)} took 0.660 sec. (75701.488 per sec)

$ /usr/local/bin/ruby ~/Desktop/simple-bench.rb
Pavel's trivial ruby benchmark V.0.1
1000000 x {i+=1} took 0.142 sec. (7.023 mio. per sec)
2000000 x {i = my_add(i, 1)} took 0.410 sec. (4.882 mio. per sec)
50000 x {i = fullMatMult(a, b)} took 0.658 sec. (75979.874 per sec)

$ /usr/local/bin/ruby ~/Desktop/simple-bench.rb
Pavel's trivial ruby benchmark V.0.1
1000000 x {i+=1} took 0.143 sec. (7.002 mio. per sec)
2000000 x {i = my_add(i, 1)} took 0.409 sec. (4.889 mio. per sec)
50000 x {i = fullMatMult(a, b)} took 0.660 sec. (75772.730 per sec)

Python 2.4


$ python2.4 ~/Desktop/simple-bench.py
Pavel's trivial python benchmark V.0.1
10000000 x {i = i + 1} took 2.54 sec. ( 3.93700787402 mio. per sec), i= 10000000
5000000 x {i = my_add(i, 2)} took 2.46 sec. ( 2.0325203252 mio. per sec)
100000 x {i = fullMatMult(a, b)} took 1.75 sec. ( 57142.8571429 per sec)

$ python2.4 ~/Desktop/simple-bench.py
Pavel's trivial python benchmark V.0.1
10000000 x {i = i + 1} took 2.54 sec. ( 3.93700787402 mio. per sec), i= 10000000
5000000 x {i = my_add(i, 2)} took 2.46 sec. ( 2.0325203252 mio. per sec)
100000 x {i = fullMatMult(a, b)} took 1.74 sec. ( 57471.2643678 per sec)

$ python2.4 ~/Desktop/simple-bench.py
Pavel's trivial python benchmark V.0.1
10000000 x {i = i + 1} took 2.54 sec. ( 3.93700787402 mio. per sec), i= 10000000
5000000 x {i = my_add(i, 2)} took 2.47 sec. ( 2.02429149798 mio. per sec)
100000 x {i = fullMatMult(a, b)} took 1.72 sec. ( 58139.5348837 per sec)

Python 2.5


$ python2.5 ~/Desktop/simple-bench.py
Pavel's trivial python benchmark V.0.1
10000000 x {i = i + 1} took 2.5 sec. ( 4.0 mio. per sec), i= 10000000
5000000 x {i = my_add(i, 2)} took 2.53 sec. ( 1.97628458498 mio. per sec)
100000 x {i = fullMatMult(a, b)} took 1.78 sec. ( 56179.7752809 per sec)

$ python2.5 ~/Desktop/simple-bench.py
Pavel's trivial python benchmark V.0.1
10000000 x {i = i + 1} took 2.52 sec. ( 3.96825396825 mio. per sec), i= 10000000
5000000 x {i = my_add(i, 2)} took 2.52 sec. ( 1.98412698413 mio. per sec)
100000 x {i = fullMatMult(a, b)} took 1.78 sec. ( 56179.7752809 per sec)

$ python2.5 ~/Desktop/simple-bench.py
Pavel's trivial python benchmark V.0.1
10000000 x {i = i + 1} took 2.5 sec. ( 4.0 mio. per sec), i= 10000000
5000000 x {i = my_add(i, 2)} took 2.53 sec. ( 1.97628458498 mio. per sec)
100000 x {i = fullMatMult(a, b)} took 1.78 sec. ( 56179.7752809 per sec)

Perl 5.8.8


$ perl ~/Desktop/simple-bench.pl
Pavel's trivial perl benchmark V.0.1
20000000 x {i = i + 1} took 2.34329295158386sec. (8.534997720401 mio. per sec), i=20000000
5000000 x {i = my_add(i, 2)} took 3.05162501335144sec. (1.63847129910263 mio. per sec)
100000 x {i = fullMatMult(a, b)} took 3.62118482589722sec. (27615.2709148788 per sec)

$ perl ~/Desktop/simple-bench.pl
Pavel's trivial perl benchmark V.0.1
20000000 x {i = i + 1} took 2.35069394111633sec. (8.50812589856002 mio. per sec), i=20000000
5000000 x {i = my_add(i, 2)} took 3.05917191505432sec. (1.63442923079765 mio. per sec)
100000 x {i = fullMatMult(a, b)} took 3.61791110038757sec. (27640.2590404411 per sec)

$ perl ~/Desktop/simple-bench.pl
Pavel's trivial perl benchmark V.0.1
20000000 x {i = i + 1} took 2.3465690612793sec. (8.52308177501345 mio. per sec), i=20000000
5000000 x {i = my_add(i, 2)} took 3.05434393882751sec. (1.63701275957788 mio. per sec)
100000 x {i = fullMatMult(a, b)} took 3.62034606933594sec. (27621.6687810573 per sec)e178085100

All of Pavels microbenchmarks can be found here: http://acker3.ath.cx/wordpress/archives/11

I ran these tests on a MacBook Pro 2,33 GHz Intel Core 2 Duo with 2GB of RAM and some Apps running.

To be continued. And yes I know microbenchmarks are not saying anything meaningful.

[UPDATE 1]

So for completeness sake I also ran the benchmark with Python 2.5 but that didn’t really improve anything in this particular microbenchmark. The conclusion of this little exercise is that the new ruby interpreter really seems to be a lot faster than the old one. Now even ahead of some other scripting langunages in terms of speed. That is so good news!