Skip to content

1.0.0.RC1

Pre-release
Pre-release
Compare
Choose a tag to compare
@release-drafter release-drafter released this 02 Sep 14:38
· 180 commits to master since this release
312fc5f

What's Changed

This this is the first release candidate and it focuses on the performance.

Previous versions were using a native agent (in C++).
But it was problematic due to the complexity of the build plus the performance overhead of the native switch.

This release includes a major rewrite that removes the native code and now only uses the bytecode instrumentation to achieve the same result.

Not only it helped us to reduce the complexity of the project (both build-wise and code-wise, making it easier for potential contributors to submit their changes), but the performance was improved significantly!

Before:

Benchmark                                                 Mode  Cnt  Score   Error  Units
BlockHoundBenchmark.baselineBlockingCallInBlockingThread  avgt    9  0,520 ± 0,028  us/op
BlockHoundBenchmark.measureBlockingCallInBlockingThread   avgt    9  0,853 ± 0,040  us/op
BlockHoundBenchmark.measureAllowedBlockingCall            avgt    9  3,039 ± 0,145  us/op

After:

Benchmark                                                 Mode  Cnt  Score   Error  Units
BlockHoundBenchmark.measureBlockingCallInBlockingThread   avgt    9  0,528 ± 0,025  us/op
BlockHoundBenchmark.measureAllowedBlockingCall            avgt    9  0,538 ± 0,037  us/op

If a blocking call in non-non-blocking thread was previously having an overhead of ~0,320us/op, it is now close to 0,010us/op, which is already a great improvement!

But, there was a case where the implementation detail of BlockHound was adding even more overhead - allowed blocked calls (logging, class loading, etc etc).
And, if before it was ~2,500us/op, it went down to ~0,020us/op 🎉

🚀 Features / Enhancements

  • Replace native agent with ThreadLocal-based API (#46) @bsideup
  • Use ThreadLocal instead of the tags to store the non-blocking marker (#45) @bsideup
  • Add JMH microbenchmarks (#35) @szpak