Quantcast
Channel: Psychosomatic, Lobotomy, Saw
Browsing latest articles
Browse All 76 View Live

Image may be NSFW.
Clik here to view.

The Mythical Modulo Mask

It is an optimisation well known to those who know it well that % of power of 2 numbers can be replaced by a much cheaper AND operator to the same power of 2 - 1. E.g:x % 8 == x & (8 - 1)[4/11/2014...

View Article


Image may be NSFW.
Clik here to view.

The Escape of ArrayList.iterator()

{This post assumes some familiarity with JMH. For more JMH related content start at the new and improved JMH Resources Page and branch out from there!}Escape Analysis was a much celebrated optimisation...

View Article


Image may be NSFW.
Clik here to view.

MPMC: The Multi Multi Queue vs. CLQ

JCTools, which is my spandex side project for lock-free queues and other animals, contains a lovely gem of a queue called the MpmcArrayQueue. It is a port of an algorithm put forward by D. Vyukov (the...

View Article

Image may be NSFW.
Clik here to view.

HdrHistogram: A better latency capture method

Some years back I was working on a latency sensitive application, and since latency was sensitive it was a requirement that we somehow capture latency both on a transaction/event level and in summary...

View Article

Image may be NSFW.
Clik here to view.

Correcting YCSB's Coordinated Omission problem

YCSB is the Yahoo Cloud Serving Benchmark(also on wiki): a generic set of benchmarks setting out The Nimbus Cloud Serving Boardto compare different key-value store providers under a set of loads:The...

View Article


Image may be NSFW.
Clik here to view.

On Arrays.fill, Intrinsics, SuperWord and SIMD instructions

{This post turned rather long, if you get lazy feel free to skip to the summary}Let's start at the very beginning, a very good place to start... My very first post on this blog was a short rant on...

View Article

Image may be NSFW.
Clik here to view.

Porting Pitfalls: Turning D.Vyukov MPSC Wait-free queue into a j.u.Queue

{This post is part of a long running series on lock free queues, checkout the full index to get more context here}D. Vyukov is an awesome lock-free dude, and I often refer to his instructive and...

View Article

Image may be NSFW.
Clik here to view.

Degrees Of (Lock/Wait) Freedom

Yo, Check the diagonal, three brothers gone...I've been throwing around the terms lock-free and wait-free in the context of the queues I've been writing, perhaps too casually. The definition I was...

View Article


Image may be NSFW.
Clik here to view.

Object.equals, primitive '==', and Arrays.equals ain't equal

It is a fact well known to those who know it well that "==" != "equals()" the example usually going something like:  String a = "Tom";  String b = new String(a);  -> a != b but a.equals(b)It also...

View Article


Image may be NSFW.
Clik here to view.

JMH perfasm explained: Looking at False Sharing on Conditional Inlining

There is an edge that JMH (read the jmh resources page for other posts and related nuggets) has over other frameworks. That edge is so sharp you may well cut yourself using it, but given an infinite...

View Article

Image may be NSFW.
Clik here to view.

An extended Queue interface

In my work on JCTools I have implemented a fair number of concurrent access queues. The Queue interface is part of the java.util package and offers a larger API surface area than I found core to...

View Article

Image may be NSFW.
Clik here to view.

Expanding The Queue interface: Relaxed Queue Access

Continuing from previous post on the expansion of the Queue interface to support new ways of interacting with queues I have gone ahead and implemented relaxedOffer/Poll/Peek for the JCTools queues....

View Article

Image may be NSFW.
Clik here to view.

Safepoints: Meaning, Side Effects and Overheads

I've been giving a couple of talks in the last year about profiling and about the JVM runtime/execution and in both I found myself coming up against the topic of Safepoints. Most people are blissfully...

View Article


Image may be NSFW.
Clik here to view.

Wait For It: Counted/Uncounted loops, Safepoints and OSR Compilation

In this previous post about Safepoints I claimed that this here piece of code:Will get your JVM to hang and will not exit after 5 seconds, as one might expect from reading the code. The reason this...

View Article

Image may be NSFW.
Clik here to view.

Why (Most) Sampling Java Profilers Are Fucking Terrible

This post builds on the basis of a previous post on safepoints. If you've not read it you might feel lost and confused. If you have read it, and still feel lost and confused, and you are certain this...

View Article


GC 'Nepotism' And Linked Queues

I've just run into this issue this week, and it's very cute, so this here is a summary. Akka has their own MPSC linked queue implementation, and this week in was suggested they'd swap to using JCTools....

View Article

Image may be NSFW.
Clik here to view.

The Pros and Cons of AsyncGetCallTrace Profilers

So, going on from my whingy post on safepoint bias, where does one go to get their profiling kicks? One option would be to use an OpenJDK internal API call AsyncGetCallTrace to facilitate non-safepoint...

View Article


Image may be NSFW.
Clik here to view.

Fixing Coordinated Omission in Cassandra Stress

Copyright © 2016 Apache Software FoundationI have it from reliable sources that incorrectly measuring latency can lead to losing ones job, loved ones, will to live and control of bowel movements. Out...

View Article

Image may be NSFW.
Clik here to view.

4 Years Blog Anniversary

This has been a very slow year blogging wise... too much work, travel, and family. 4 years ago I aimed for 2 posts a month. I nearly hit it in 2013, failed by a little in 2014, and went on to not...

View Article

Image may be NSFW.
Clik here to view.

Linked Array Queues, part 1: SPSC

When considering concurrent queues people often go for either:An array backed queue (circular array/ring buffer etc.)A linked list queueThe trade off in the Java world seems to be that array backed...

View Article

Image may be NSFW.
Clik here to view.

Linked Array Queues, part 2: SPSC Benchmarks

JCTools has a bunch of benchmarks we use to stress test the queues and evaluate optimizations. These are of course not 'real' workloads, but serve to highlight imperfections and opportunities. While it...

View Article


Image may be NSFW.
Clik here to view.

What do Atomic*::lazySet/Atomic*FieldUpdater::lazySet/Unsafe::putOrdered*...

Paved with well intended definitions it is.lazySet/putOrdered (or an ordered store) was added as a bit of a rushed/non-commital afterthought after the JMM was done, so it's description is subject to...

View Article


Image may be NSFW.
Clik here to view.

Java Flame Graphs Introduction: Fire For Everyone!

FlameGraphs are superawesome. If you've never heard of FlameGraphs and want to dive straight in the deep end, you should run off and check out the many many good resources provided by Brendan Greg in...

View Article

Image may be NSFW.
Clik here to view.

What a difference a JVM makes?

JDK 9 is out! But as a library writer, this means change, and change can go either way... Once we've satisfied that JCTools works with JDK9, what other observations can we make? Well, one of the main...

View Article

Image may be NSFW.
Clik here to view.

How Inlined Code Makes For Confusing Profiles

Inlining is a powerful and common optimization technique used by compilers. But inlining combines with other optimizations to transform your code to such an extent that other tooling becomes confused,...

View Article

Browsing latest articles
Browse All 76 View Live


Latest Images