d7d8503f5c
Using DelimiterBasedFrameDecoder with Delimiters.lineDelimiter() has quadratic performance in the size of the input buffer. Needless to say, the performance degrades pretty quickly as the size of the buffer increases. Larger MTUs or loopback connections can make it so bad that it appears that the code is "busy waiting", when in fact it's spending almost 100% of the CPU time in DelimiterBasedFrameDecoder.indexOf(). Add a new LineBasedFrameDecoder that decodes line-delimited frames in O(n) instead of DelimiterBasedFrameDecoder's O(n^2) implementation. In OpenTSDB's telnet-style protocol decoder this resulted in throughput increases of an order of magnitude. Change DelimiterBasedFrameDecoder to automatically detect when the frames are delimited by line endings, and automatically switch to using LineBasedFrameDecoder under the hood. This means that all Netty applications out there that using the combo DelimiterBasedFrameDecoder with Delimiters.lineDelimiter() will automatically benefit from the better performance of LineBasedFrameDecoder, without requiring a code change. |
||
---|---|---|
all | ||
buffer | ||
codec | ||
codec-http | ||
codec-socks | ||
common | ||
example | ||
handler | ||
license | ||
metrics-yammer | ||
tarball | ||
testsuite | ||
transport | ||
.fbfilter.xml | ||
.fbprefs | ||
.gitignore | ||
LICENSE.txt | ||
NOTICE.txt | ||
pom.xml | ||
README.md |
The Netty Project
Netty is an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers & clients.
Links
-
Web Site: http://netty.io/
-
Docs: http://netty.io/docs/
-
Blog: http://netty.io/blog/
-
Twitter: @netty_project
Getting Netty
-
Download Page: http://netty.io/downloads/
-
Maven Repository:
<dependencies>
...
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
<version>X.Y.Z.Q</version>
<scope>compile</scope>
</dependency>
...
</dependencies>
Developer Information
-
Netty is setup to build using Maven
-
You need JDK 7 to build Netty. Netty will run with JDK 5 (3.x) and JDK 6 (4).
-
master branch contains code for Netty 4.x
-
3 branch contains code for Netty 3.x