Home » Author Archives: Ashkrit Sharma

Author Archives: Ashkrit Sharma

Pragmatic software developer who loves practice that makes software development fun and likes to develop high performance & low latency system.

Efficiency with Algorithms

software-development-2-logo

Recently had look at excellent talk on Efficiency with Algorithms, Performance with Data Structures , this talk has really some good content on performance. In this blog i will share some of ideas from above talk and few things that i have learned. Pre processing This is very common trick, this is trade off between processing required when actual requests comes ...

Read More »

Factory Without IF-ELSE

java-logo

Object Oriented Language has very powerful feature of Polymorphism, it is used to remove if/else or switch case in code. Code without condition is easy to read. There are some places where you have to put them and one of such example is Factory/ServiceProvider class. I am sure you have seen factory class with IF-ELSEIF which keeps on getting big. ...

Read More »

Off Heap concurrent counter

software-development-2-logo

Concurrent counter are part of almost every system, it is used to collect data, thread synchronization etc. Java has good support of heap based counter. There could be use case when you need counter that can be shared between processor.           How to build inter process counters Database This is first option that comes to mind, ...

Read More »

Scalable Counters For Multi Core

java-logo

Counters are required everywhere , for e.g. to find key KPI of application, load on application, total number of request served, some KPI for finding throughput of application & many more. With all these requirement complexity of concurrency is also added & that makes this problem interesting. How to implement concurrent counter     Synchronized – This was the only ...

Read More »

Which memory is faster Heap or ByteBuffer or Direct ?

java-logo

Java is becoming new C/C++ , it is extensively used in developing High Performance System. Good for millions of Java developer like me! In this blog i will share my experiment with different types of memory allocation that can be done in java and what type of benefit you get with that. Memory Allocation In Java What type of support ...

Read More »

ArrayList Using Memory Mapped File

java-logo

Introduction In-Memory computing is picking up due to affordable hardware, most of the data is kept in RAM to meet latency and throughput goal, but keeping data in RAM create Garbage Collector overhead especially if you don’t pre allocate. So effectively we need garbage less/free approach to avoid GC hiccups Garbage free/less data structure There are couple of option to achieve ...

Read More »

Lock Less Java Object Pool

java-logo

It has been a while since I wrote anything, I have been busy with my new job that involves doing some interesting work on performance tuning. One of the challenges is to reduce object creation during the critical part of the application. Garbage Collection hiccups has been a main pain point in java for some time, although java has improved over time the ...

Read More »

Experiment with ConcurrentHashmap

java-logo

I am investigating a memory issue in one of my recent projects where data is kept in memory for fast access, but the memory footprint of application is very high. This application was heavily using CHM(i.e Concurrenthashmap), so no brainier guess was required that CHM was the issue. I did a memory profiling session to find how much memory CHM was really taking. ...

Read More »

Latency number that you should know

software-development-2-logo

Latency number that you should know Many of you work on low latency & high throughput systems. The key to developing such systems is understanding latency, be it of CPU cache, RAM, disk or network. I found some interesting latency numbers, understanding these numbers is very important because all these are based on speed of light and we all know that ...

Read More »

Power of Java MemoryMapped File

java-logo

Power of Java MemoryMapped File In JDK 1.4 an interesting feature of Memory mapped file was added to Java, which allows to map any file to OS memory for efficient reading. A memory mapped file can be used to develop an  IPC type of solution. This article is an experiment with memory mapped file to create IPC. Some details about ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.