Archive

Archive for the ‘Uncategorized’ Category

Scala performance analysis with perf and Flame Graphs

10.09.2017 Leave a comment

I’ve been toying with Scala profiling lately. I find CPU Flame Graphs to be cool and useful, so decided to see what I can do with that. After some hacking and automating I got this:

flame chart

One thing I find strange here is that scala.collection methods are shown as yellow, which according to The Source means they are C++ code. Overall, it seems like in this very simple case, it’s possible to see where the problems are. If there were any kernel-level operations involved, like network communication, the chart would be even more useful.

Advertisements
Categories: Uncategorized Tags: ,

Scalar 2016

26.04.2016 Leave a comment

I attended the scalar conference in Warsaw. This is a short write-up of some of my thoughts about it.

By far the most interesting talk was given by Mathias Doenitz, who described his project Swave, which is a Rective Streams protocol implementation intending to be usable both in place of standard Scala/Java collections and distributed processing systems like Akka Stream or Apache Storm. I was looking forward to such a “write once, run everywhere” framework for quite some time, I will definitely be watching it’s progress.

On last year’s Scalar, the most interesting talk was given by Heather Miller, a PHD student of professor Martin Odersky. It seems someone from “Scala headquarters” is sent to Warsaw every year. This year’s emissary was Dmytro Petrashko, who talked about some unexpected behaviours of Scala initialization order. It was definitely interesting, but did gave me a pause thinking about unexpected complexity of having multiple mixins in a class.

Presentation of Amira Lakhal was also quite interesting but not from technical point of view. Amira is “one of the Duchess France leaders where she helps women in IT to became role models”. She demonstrated a simple but complete machine learning system, gathering accelerometer data from an Android device to detect if the user was standing, walking or running. Talk was very well prepared and it seem Amira’s strategy is to show some real-world, tangible application. Frankly, it was a welcome break because many of the other presenters (not mentioned here) were so out of touch with reality that it felt like a symposium on string theory.

The conference itself was very well organised, in particular the venue was really great. However, all of the talks were really short and there was almost no time for questions. I must also say that the conference host seemed rude and sexist. But maybe I just have high expectations, having attended conferences hosted by RafaƂ Motriuk – this guy is just pure awesomeness on stage. Despite those minor glitches, the conference was great and I am looking forward to visiting it next year.

Categories: Uncategorized

Deamon slayer

14.01.2013 Leave a comment

A nice gotcha – what happens when you forget about destructors when writing server-side code in C++ can be found on Rachel’s blog.

Categories: Uncategorized

Programming like it’s 1975

05.12.2012 Leave a comment

Some tips about getting optimal performance from modern hardware and operating systems. Author argues that application programmer has no way of knowing if the memory in RAM or cached out to disc, so it’s best to not to interfere with kernel. The other smart point is using worker threads in “most recently busy” fashion – a bit counterintuitive but makes perfect sense.
Edit: A discussion on hackernews raises several points when it comes to memory management. It’s getting increasingly rare to find a technical discussion there, this one seems better.

Categories: Uncategorized

Stop the train!

11.10.2012 Leave a comment

A nice example of branch prediction can be found here. Discussion under “Update” mentions Intel compiler and it’s cool ability to do loop interchange. Extra credit for well-fitting railway analogy.

Categories: Uncategorized

Oracle – how add milisecond to a timestamp value?

06.09.2012 Leave a comment

Recently somebody needed to add a millisecond to a timestamp value in Oracle. You can’t do just

 select systimestamp + 1 / 24 / 60 / 60 / 1000 from dual; 

because the ‘+’ converts timestamp to date and fractional seconds are lost. The (supposedly) wise guy here seems to suggest that the way to go is to create a custom function in Java… Come on Oracle, there should be a better way to do this!

Categories: Uncategorized

OpenJPA errors are sometimes less than informative

06.06.2012 Leave a comment

When you see OpenJPA error claiming that a column does not exist in database and you clearly see it, make sure the instance field in question is private. At least, packet visibility seems to cause problems in case of annotations at field level. Such an error just ate 4 hours of my time.

This seems to be at odds with JPA 3.0 standard, which explicitly allows protected and packet visibility for instance fields (chapter 2.1). The current OpenJPA documentation for 2.2 release doesn’t list this deviation from standard (http://openjpa.apache.org/builds/apache-openjpa-2.2.1-SNAPSHOT/docs/docbook/manual.html#jpa_2.0_incompatibilities).

Categories: Uncategorized