grpc-java/netty
Carl Mastrangelo 71967622d6
core, netty: add io.perfmark Annotations
This add perfmark annotations in some key places, notably on transport/application boundaries, and thread hop locations. Perfmark records to a thread-local buffer the events that happen in each thread. Perfmark is disabled by default, and will compile to a noop unless Perfmark.setEnabled is invoked. This should make it free when disable, and pretty fast when it is enabled.

It is important that started tasks are ended, so several places in our code are moved to either try-finally blocks, or moved into a private method. I realize this is ugly, but I think it is manageable. In the future, we can look at making an agent or compiler plugin that simplifies the recording.

Linking between threads is done with a Link object, which is created on the "outbound" task, and used on the "inbound" task. This is slightly more verbose, and does has a small amount of runtime overhead, even when disabled. (for null checks, slightly higher memory usage, etc.) I think this is okay to, because it makes other optimizations much easier.
2019-06-06 17:58:49 -07:00
..
shaded netty: change default transport to Epoll if available, otherwise using Nio (#5581) 2019-04-15 17:53:14 -07:00
src core, netty: add io.perfmark Annotations 2019-06-06 17:58:49 -07:00
BUILD.bazel core, netty: add io.perfmark Annotations 2019-06-06 17:58:49 -07:00
build.gradle netty: change default transport to Epoll if available, otherwise using Nio (#5581) 2019-04-15 17:53:14 -07:00