New = better?

It is almost obvious that “new” not always meets expectations. Some might not agree with me and some might think it is an example discussed so many times, nobody cares already – but I just have to mention Windows Vista. Released 6 years after Windows XP, was especially loathed for its low performance and became usable after serious tweaking.

Fortunately, OTP releases are much more frequent; a few days ago R15B03 version was released. One doesn’t expect major changes from minor release but what about major versions? R13, R14 and R15?

Of course, R15 is most feature-rich, there is no doubt. It’s a shame we had to wait until R15 to get something as basic as line numbers in stacktraces. But has anything changed in terms of performance?

The case I would like to present is Erlang Jabber server. Luckily it can be compiled under R13, R14 and R15 with no changes in the code necessary. What were the results of load tests I conducted?
Well, I was quite surprised. There was no difference in memory usage but let’s say that no change is sometimes a good news. On the other hand, CPU usage was 10% higher in case of R15! I didn’t have time to inspect what could have caused such a difference, but I must admit I’m a bit afraid of R16 release. 🙂

I haven’t done any tests for R13 but I’ve heard from someone else that he could observe the same difference between R13 and R14. In total it gives 20% higher CPU usage in R15 compared to R13.

I just hope this is not a pattern and we don’t get 30% score with R16. Right now, it is difficult to resist a thought, that maybe we should do development and testing (line numbers!) with R15 but deploy our systems on R14? 🙂

EDIT:

Thanks to Henrik, I googled a blog post about this behaviour and also original Rickard Green explanation. It turns out the cause is schedulers working “just in case” before they go to sleep. Fortunately it can be managed with +sbwt switch for erl command.
My apologies, OTP team!

Advertisements
This entry was posted in Erlang and tagged , , , , . Bookmark the permalink.

2 Responses to New = better?

  1. Henrik says:

    The increase in Cpu usage is a bi product of changes in the schedulers, its not “real” cpu usage, it is busy wait, so it leads to decreased response time, and smaller queues. There is a explanation about this on the erlang bugs list, look for posts by Rikard green.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s