One of our services recently started to perform multiple inserts and deletes in MySQL database. To the point of a noticeable response time increase. Batching of SQL queries is nothing new, but I decided to wander around this topic a bit in Internet, and stumbled upon something I never heard…

UPD: Apparently, in top 5 results from Google, there are no correct examples, changed text accordingly.

Resource management is a very important topic in software development. Also, it is hard to add something new to it. The topic is covered pretty well in all kinds of blog posts, articles, and…

Performance comparison between different kinds of string concatenation/formatting in Java/Scala

UPD: Here is the Pull Request to scala-compiler with changes inspired by this post.

String concatenation is a basic building block in every modern programming language. Many different projects, especially in Web, produce a lot of strings. And it’s interesting, how this problem is solved in different languages. …

Yet another post about performance and microbenchmarks. Yes, I know.

Very small JMH benchmark:

@Fork(value = 2, jvmArgs = Array("-Xmx2G"))
@Measurement(iterations = 7, time = 3, timeUnit = TimeUnit.SECONDS)
@Warmup(iterations = 3, time = 3, timeUnit = TimeUnit.SECONDS)
class StringBuilderBenchmark {

def javaStringBuilder: String = {

I’ve just created a site on GitHub Pages: There I’ve put my recent benchmark results from the Scala Serialization article.

Things changed:

  1. Results gathered via JMH.
  2. Added benchmark for two-way action: serialization and deserialization.
  3. In JMH I use 2 threads instead of 1 (so, I check libraries in multi-threaded environment).
  4. Chill doesn’t behave well (sometimes deserialization fails with “Buffer underflow” exception, it is related to multi-threading, but I didn’t have enough time to investigate).
  5. Libraries versions are updated (boopickle, pickling, scalapb). Scala Pickling improved significantly.

Thanks to everyone for comments, pull requests and shares.

Dmitry Komanov

Software developer, moved to Israel from Russia, trying to be aware of things.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store