Tag: java
-
KISS: Hand crafted JSON is NOT faster than ObjectMapper
Premature optimisations are evil. Apart from being buggy, they might actually be slower than the industry standard.
-
Taming a throttled API with Dynamic Proxies in Java
Recently, at CleverTap, we’ve begun migrating some of our largest clusters to a new protocol (for starters, think ~115 instances at a time). One of the most fun things I’ve had my hands on during this migration was the AWS Systems Manager API. When we scaled up our migrations gradually from a 10 node cluster,…
-
IntelliJ on steroids with G1 GC
Lately, I noticed that IntelliJ started to pause for quite some time during it’s GC cycles, and that it was very frequent when I was editing three files (over 1.2k LOC each) split vertically. The current version of IntelliJ runs on a bundled version of Java 1.8, who’s default garbage collector is Parallel GC. While…
-
0f > Float.MIN_VALUE = false!
Updates: Turns out that this is the expected behaviour from the java doc: A constant holding the smallest positive nonzero value of type float, 2-149. So now, how do I get the smallest negative value that a float can hold? Just came across the most weirdest thing ever in Java – 0f > Float.MIN_VALUE returns…
-
How to get a File object of an Android raw resource using reflection
Context: You have a URI to a resource which is placed in the raw directory inside the Android resources directory, res. Say you want to take that raw resource(let’s say it’s an image) and add it to an attachment using FIleBody to a MultiPartEntity. Both these classes are available in the Apache HTTP Components library. FileBody…