Background
There is a famous tool called Wireshark . I have been using it for ages. This is great, but performance is a problem. A common use case involves several steps in preparing data to retrieve a subset of data that will be analyzed later. Without this step, it takes several minutes to filter (with large Wireshark routes near the unusable).

The real idea is to create the best solution, fast, parallel and efficient, which will be used as an aggregator / data warehouse.
Requirements
The actual requirement is to use all the power provided by modern equipment. I have to say that there is a place for various types of optimization, and I hope that I have done a good job on the upper layers, but technology is the main issue right now. In accordance with the current design, there are several options for packet decoders (dissectors):
- interactive decoders: decoding logic can be easily changed at runtime. This approach can be very useful for protocol developers - decoding speed is not critical, but flexibility and fast results are more important.
- embedded decoders: can be used as a library. This type should have good performance and be flexible enough to use all available processors and cores.
- decoders as a service: can be accessed through a clean API. This type should provide the best performance and breed efficiency.
results
My current solution is JVM-based decoders. The real idea is to reuse the code, eliminate porting, etc., but still have good performance.
- Interactive decoders: implemented on Groovy
- Embedded Decoders: Implemented in Java
- Decoders as a service: Tomcat + optimization + embedded decoders wrapped in a servlet (binary input, XML output)
Problems to be Solved
- Groovy provides a way of more power and everything, but gives expressiveness in this particular case.
- The decoding protocol in the tree structure is a dead end - too many resources are simply lost.
- Memory consumption is somewhat difficult to control. I made several optimizations, but still not happy with the profiling results.
- Tomcat with various bells and whistles still introduces a lot of overhead (mostly connection processing).
Am I using JVM correctly everywhere? Do you see any other good and elegant way to achieve your original goal: get easy-to-write scalable and efficient protocol decoders?
Protocol, format of results, etc. not fixed.
Renat gilmanov
source share