question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BatchEventProcessor.processEvents performance

See original GitHub issue

While profiling a simple D-Bus-based application, I noticed the following:

     1764406    2.74%        1  OptoRuntime::handle_exception_C_helper(JavaThread*, nmethod*&)

The application is not in any failure scenario, so I would have expected that all messages could be processed without throwing exceptions. The exception handling is inside processEvents:

https://github.com/LMAX-Exchange/disruptor/blob/305d7371765b0cf0f670a059cbfaf9e0691da27c/src/main/java/com/lmax/disruptor/BatchEventProcessor.java#L156

The profile output shows:

--- 2116394 ns (3.28%), 1 sample
  [ 0] exit_to_usermode_loop_[k]
  [ 1] prepare_exit_to_usermode_[k]
  [ 2] swapgs_restore_regs_and_return_to_usermode_[k]
  [ 3] OptoRuntime::handle_exception_C_helper(JavaThread*, nmethod*&)
  [ 4] OptoRuntime::handle_exception_C(JavaThread*)
  [ 5] com.lmax.disruptor.BatchEventProcessor.processEvents
  [ 6] com.lmax.disruptor.BatchEventProcessor.run
  [ 7] java.lang.Thread.run

I don’t know what particular exception is causing the exception catch clause to be invoked, if any, or if there’s anything that can be changed to improve the performance. Feel free to close if nothing practical can be done.

The full async-profile log is attached.

dbus-2.log

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
grumpyjamescommented, Aug 19, 2022

Also, in case I haven’t made it clear: that timeout exception is thrown when a ringbuffer consumer sees no events for a configured amount of time. We could probably rename all the timeout parts as “onTemporarilyIdle” or similar.

That rather suggests that the thread in question is probably not of that much interest to your profile anyway.

0reactions
DaveJarviscommented, Aug 19, 2022

Closing as not applicable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

LMAX Disruptor User Guide
The LMAX Disruptor is a high performance inter-thread messaging library. ... There is a single representation called BatchEventProcessor that contains an ...
Read more >
BatchEventProcessor (Disruptor) - javadoc.io
Convenience class for handling the batching semantics of consuming entries from a RingBuffer and delegating the available events to an EventHandler . If...
Read more >
Re: Log4j2 Async Logging with LMAX Disruptor
Any appenders or filters that could be a performance bottleneck? ... processEvents() > BatchEventProcessor.java:168 > com.lmax.disruptor.
Read more >
"Appender JDAAppender" Error - High Performance Minecraft
The error appears when starting up the server and when I use the /list command of EssentialsX, but I don't know if it...
Read more >
Getting lots of context canceled - internal error in APM server ...
You may need to tune the APM Server performance and/or reduce the sampling rate to reduce ... processEvents(BatchEventProcessor.java:168)
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found