Last Friday, I gave a talk a the LinuxTag conference in Berlin (BTW, "Tag" means "Day" in German) on Cassandra. The goal was to give an introduction to Cassandra and also talk a bit about the experiences we've made with Cassandra at TWIMPACT.
I also got some interesting feedback. In particular, someone pointed out that we're having pretty atypically high write rates in our analysis application compared to normal web applications, also leading to more frequent compaction.
I probably should also add that we've recently moved away from Cassandra to a completely memory based approach. We felt that real-time demanded that you hold all your important data in memory and use disk only to store logs and other aggregated data.
I'm also not saying that Cassandra (or Postgres for the matter) is inherently slow or buggy, I think (as always) it's very much a matter of what kinds of requirements you have.
Finally I find some time to recompile the ATLAS libraries for jblas. As it has turned out, the libraries which shipped with jblas 1.2.0 were 30% to 50% slower than what shipped in earlier versions. This still made jblas faster than pure Java implementations, but there are still a lot of FLOPS missing.
To solve this problem once and for all, I did some exhaustive benchmarkings of compiling and running ATLAS on different platforms. I started with 64 bit Linux and the SSE3 settings. I used the following two processors:
Above are the results for compiling on the i7 or on the Opteron and running on the i7 or the Opteron processor. The numbers shown are relative MFLOPS for large matrix-matrix multiplications (100 would mean 1 floating point operation per clock cycle). The best setting is shown in green, those above 90% of that in orange, and those below in red. Numbers which are missing didn’t compile or run.
As you can see, it’s really not that easy to pick the best configuration. It’s not even the case that the architecture presets for the given platform produce the best results.
If you build on the Core i7, the presets Core2Solo, Core2, and UNKNOWNx86 lead to good performances both on the Core i7 and the Opteron. If you build on the Opteron, there is no preset which gives good results on both processors.
So I think I’ll settle on the Core2Solo which will give the following results:
To really get the best possible performance, you’d need to use the best possible implementation, but that would mean to inflate the jar even more.
I’m note sure which road to take here. GotoBlas2 has recently been released under a BSD licence and also shows very promising results, which would further increase the number of shared libraries to put in the jar file.
Another option would be to have a central repository with all kinds of libraries, and then you would need to download and install the right one the first time you run jblas. Would that be too bad?
Often, when you search around for posts on Scala, you find pretty scary looking posts which discusses some rather advanced topic of the Scala type system or something similar, or just how functional Scala is by reimplementing ideas from Haskell in it.
On the other hand, I’ve been using Scala for more than a year now, and I find the whole experience very agreable, not because of the crazy stuff you can do in Scala (well, at least, not ONLY because of the crazy stuff), but because of the everyday improvements over Java Scala provides. For example:
Map[String,String] table = new HashMap[String,String];
. The
default is that the variable is just the type of its initial value.In any case, here is what’s necessary to get you started with Scala (assuming you already know enough Java and the infrastructure.)
Just download Scala, unpack and add the “bin” directory to your PATH.
I’ve tried the following three IDEs.
You can go with either maven or sbt.
I found that a great way to start playing around with ideas is to use the script mode of Scala. You can directly run files by typing “scala some-file.scala”. In Scala, you can put as many classes into a file as you want, so why not just do a quick sketch of your ideas in a single file.
For all those people coming from Java, here is a short list of things you should know:
Unfortunately, the current implementation of the scala compiler takes very long to start up (a few seconds). To improve this, the scala distribution comes with a scala server called “fsc” which runs in the background, and you should definitely use it.
In Maven, the default to use fsc is controlled by the useFsc parameter of the scala:cc goal, but the default is true according to the documentation.
In IDEA, you control the setting through “Compiler > Scala > Use fsc (fast scalac)”.
Using fsc also has it quirks. Sometimes, when a lot of classes change or are renamed, it gets confused and needs to be restarted with “fsc -reset”. Especially on Linux, IDEA cannot compile if the fsc isn’t already running. You can vote up the bug, for the mean time, you need to periodically run a small compilation in order to keep fsc from shutting down.
Before I start to work, I start the following script
with the file helloworld.scala being the one-liner
or something similar.