
Java Microbenchmark Harness (JMH)
Introduction In my previous article I established that microbenchmarking is hard with jvm. It is not enough to surround the code in a loop with System.out.println() and gather the time measurements...
Introduction In my previous article I established that microbenchmarking is hard with jvm. It is not enough to surround the code in a loop with System.out.println() and gather the time measurements...
Introduction Optimisation of code is an endless struggle. It is often even hard to produce meaningful metrics using jvm as it is an adaptive virtual machine. The article is a brief introduction ...
Introduction One of the most common ADT that a developer uses in their day-to-day coding is List. And one of the most common operations a developer performs on a list is to order it or sort it wit...
Similar to Java, Scala also supports variable arguments or repeated method parameters. The concept is really useful in situations when you don’t know how many parameters you need to pass to a metho...
As per Wikipedia, “Lazy Evaluation is an evaluation strategy which delays the evaluation of an expression until its value is needed.” And today most of the modern programming languages support Lazy...
Before we begin discussing closures in Scala, let us have a quick look at a function. The function literal bill below accepts only one input parameter: netBill. However, the function calculates the...
As the name suggests, partial functions are only partial implementations. They do not cover every possible scenario of incoming parameters. A partial function caters to only a subset of possible da...
Currying is named after Haskell Curry, an American mathematician. He is known for his work in combinatory logic. Currying is a means of transforming a function that takes more than one argument in...
Scala, like many other functional languages, allows developers to apply functions partially. What this means is that, when applying a function, a developer does not pass in all the arguments define...
Introduction Recursion is quite common in the programming world. As you probably know, it’s the process of solving a problem by breaking it down into smaller subproblems. You can easily spot recurs...