π gnet is a high-performance, lightweight, non-blocking, event-driven networking framework written in pure Go./ gnet ζ―δΈδΈͺι«ζ§θ½γθ½»ιηΊ§γιι»ε‘ηδΊδ»Άι©±ε¨ Go η½η»ζ‘ζΆγ
Visit also Announcing gnet v2.5.0
Thanks to all these contributors: @daynobug and @panjf2000 for making this release possible.
Full Changelog: https://github.com/panjf2000/gnet/compare/v2.4.0...v2.5.0
Full Changelog: https://github.com/panjf2000/gnet/compare/v2.3.0...v2.4.0
Thanks to all these contributors: @leslie-fei and @panjf2000 for making this release possible.
Full Changelog: https://github.com/panjf2000/gnet/compare/v2.3.0...v2.4.0
The two major updates in this release candidate are #460 and #461.
We introduced a new data structure matrix
in #460 to displace the default map
for managing connections internally, with the help of this new data structure, we can eliminate the pointers in map
and store connections in the form of a matrix (an array of slices), which will significantly reduce GC (Garbage Collection) latency:
goos: darwin
goarch: arm64
pkg: github.com/panjf2000/gnet/v2
β old β new β
β sec/op β sec/op vs base β
GC4El100k/Run-4-eventloop-100000-10 30.74m Β± 3% 19.68m Β± 10% -35.98% (p=0.000 n=10)
GC4El200k/Run-4-eventloop-200000-10 63.64m Β± 3% 38.16m Β± 11% -40.04% (p=0.000 n=10)
GC4El500k/Run-4-eventloop-500000-10 177.28m Β± 8% 95.21m Β± 4% -46.29% (p=0.000 n=10)
geomean 70.26m 41.51m -40.92%
β old β new β
β B/op β B/op vs base β
GC4El100k/Run-4-eventloop-100000-10 27.50 Β± 35% 25.50 Β± 33% ~ (p=0.423 n=10)
GC4El200k/Run-4-eventloop-200000-10 27.50 Β± 53% 20.50 Β± 66% ~ (p=0.642 n=10)
GC4El500k/Run-4-eventloop-500000-10 16.00 Β± ? 18.00 Β± ? ~ (p=0.357 n=10)
geomean 22.96 21.11 -8.04%
β old β new β
β allocs/op β allocs/op vs base β
GC4El100k/Run-4-eventloop-100000-10 0.000 Β± 0% 0.000 Β± 0% ~ (p=1.000 n=10) ΒΉ
GC4El200k/Run-4-eventloop-200000-10 0.000 Β± 0% 0.000 Β± 0% ~ (p=1.000 n=10) ΒΉ
GC4El500k/Run-4-eventloop-500000-10 0.000 Β± 0% 0.000 Β± 0% ~ (p=1.000 n=10) ΒΉ
geomean Β² +0.00% Β²
ΒΉ all samples are equal
Β² summaries must be >0 to compute geomean
The more connections there are, the more pronounced the effect.
While we have performed sufficient testing on matrix
, we are still using map
as the default connection storage in this RC version for the sake of caution, but you can enable the new data structure by specifying build tags: -tags=gc_opt. This can be considered as a precautionary measure so that in case matrix
has any unexpected bugs, you can quickly fall back to the default map
. We will consider promoting matrix
to be the default storage for connections in a subsequent official release.
Another significant leap is #461, you can now run gnet
on Windows, it should be noted that the Windows version of gnet
is intended for development purposes and is not recommended for use in production.
Full Changelog: https://github.com/panjf2000/gnet/compare/v2.2.0...v2.3.0
Thanks to all these contributors: @0-haha, @GXKe, @gocurr, @jinxing3114 and @panjf2000 for making this release possible.
The two major updates in this release candidate are #460 and #461.
We introduced a new data structure matrix
in #460 to displace the default map
for managing connections internally, with the help of this new data structure, we can eliminate the pointers in map
and store connections in the form of a matrix (an array of slices), which will significantly reduce GC (Garbage Collection) latency:
goos: darwin
goarch: arm64
pkg: github.com/panjf2000/gnet/v2
β old β new β
β sec/op β sec/op vs base β
GC4El100k/Run-4-eventloop-100000-10 30.74m Β± 3% 19.68m Β± 10% -35.98% (p=0.000 n=10)
GC4El200k/Run-4-eventloop-200000-10 63.64m Β± 3% 38.16m Β± 11% -40.04% (p=0.000 n=10)
GC4El500k/Run-4-eventloop-500000-10 177.28m Β± 8% 95.21m Β± 4% -46.29% (p=0.000 n=10)
geomean 70.26m 41.51m -40.92%
β old β new β
β B/op β B/op vs base β
GC4El100k/Run-4-eventloop-100000-10 27.50 Β± 35% 25.50 Β± 33% ~ (p=0.423 n=10)
GC4El200k/Run-4-eventloop-200000-10 27.50 Β± 53% 20.50 Β± 66% ~ (p=0.642 n=10)
GC4El500k/Run-4-eventloop-500000-10 16.00 Β± ? 18.00 Β± ? ~ (p=0.357 n=10)
geomean 22.96 21.11 -8.04%
β old β new β
β allocs/op β allocs/op vs base β
GC4El100k/Run-4-eventloop-100000-10 0.000 Β± 0% 0.000 Β± 0% ~ (p=1.000 n=10) ΒΉ
GC4El200k/Run-4-eventloop-200000-10 0.000 Β± 0% 0.000 Β± 0% ~ (p=1.000 n=10) ΒΉ
GC4El500k/Run-4-eventloop-500000-10 0.000 Β± 0% 0.000 Β± 0% ~ (p=1.000 n=10) ΒΉ
geomean Β² +0.00% Β²
ΒΉ all samples are equal
Β² summaries must be >0 to compute geomean
The more connections there are, the more pronounced the effect.
While we have performed sufficient testing on matrix
, we are still using map
as the default connection storage in this RC version for the sake of caution, but you can enable the new data structure by specifying build tags: -tags=gc_opt. This can be considered as a precautionary measure so that in case matrix
has any unexpected bugs, you can quickly fall back to the default map
. We will consider promoting matrix
to be the default storage for connections in a subsequent official release.
Another significant leap is #461, you can now run gnet
on Windows, it should be noted that the Windows version of gnet
is intended for development purposes and is not recommended for use in production.
Full Changelog: https://github.com/panjf2000/gnet/compare/v2.2.0...v2.3.0-rc.1
Thanks to all these contributors: @panjf2000, @0-haha, @GXKe, and @jinxing3114 for making this release possible.
Full Changelog: https://github.com/panjf2000/gnet/compare/v2.0.0...v2.2.0
Thanks to all these contributors: @0-haha, @JemmyH, @ccssrryy, @jdamick, @leki75, @panjf2000, @zhongweikang and zhongweikang for making this release possible.
Today, I'm thrilled to announce the release of gnet v2.0.0, in which we've made plenty of significant improvements and optimizations: added and removed some APIs, redesigned and reimplemented the buffer, optimized the memory pool, etc.
Please visit the blog post of announcing gnet v2.0.0 for more details.
net
package to create listeners ccc8c649f380c546242251911040c8935a2cbb57go build
tags of operating systems 637144b487d4fa4f0a3ef40a2dada40586e188b5