good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
websocket
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
websocket
Commits
9fdcb5d7
Unverified
Commit
9fdcb5d7
authored
Oct 19, 2023
by
Anmol Sethi
Browse files
Options
Downloads
Patches
Plain Diff
Misc fixes
parent
fb3b083e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+1
-1
1 addition, 1 deletion
README.md
ci/test.sh
+9
-9
9 additions, 9 deletions
ci/test.sh
compress.go
+13
-13
13 additions, 13 deletions
compress.go
make.sh
+4
-0
4 additions, 0 deletions
make.sh
with
27 additions
and
23 deletions
README.md
+
1
−
1
View file @
9fdcb5d7
# websocket
# websocket
[

](https://pkg.go.dev/nhooyr.io/websocket)
[

](https://pkg.go.dev/nhooyr.io/websocket)
[

](https://nhooyrio
-
websocket
-
coverage.
netlify.app
)
[

](https://nhooyr
.
io
/
websocket
/
coverage.
html
)
websocket is a minimal and idiomatic WebSocket library for Go.
websocket is a minimal and idiomatic WebSocket library for Go.
...
...
This diff is collapsed.
Click to expand it.
ci/test.sh
+
9
−
9
View file @
9fdcb5d7
...
@@ -2,6 +2,15 @@
...
@@ -2,6 +2,15 @@
set
-eu
set
-eu
cd
--
"
$(
dirname
"
$0
"
)
/.."
cd
--
"
$(
dirname
"
$0
"
)
/.."
(
cd
./internal/examples
go
test
"
$@
"
./...
)
(
cd
./internal/thirdparty
go
test
"
$@
"
./...
)
go
install
github.com/agnivade/wasmbrowsertest@latest
go
install
github.com/agnivade/wasmbrowsertest@latest
go
test
--race
--bench
=
.
--timeout
=
1h
--covermode
=
atomic
--coverprofile
=
ci/out/coverage.prof
--coverpkg
=
./...
"
$@
"
./...
go
test
--race
--bench
=
.
--timeout
=
1h
--covermode
=
atomic
--coverprofile
=
ci/out/coverage.prof
--coverpkg
=
./...
"
$@
"
./...
sed
-i
.bak
'/stringer\.go/d'
ci/out/coverage.prof
sed
-i
.bak
'/stringer\.go/d'
ci/out/coverage.prof
...
@@ -12,12 +21,3 @@ sed -i.bak '/examples/d' ci/out/coverage.prof
...
@@ -12,12 +21,3 @@ sed -i.bak '/examples/d' ci/out/coverage.prof
go tool cover
-func
ci/out/coverage.prof |
tail
-n1
go tool cover
-func
ci/out/coverage.prof |
tail
-n1
go tool cover
-html
=
ci/out/coverage.prof
-o
=
ci/out/coverage.html
go tool cover
-html
=
ci/out/coverage.prof
-o
=
ci/out/coverage.html
(
cd
./internal/examples
go
test
"
$@
"
./...
)
(
cd
./internal/thirdparty
go
test
"
$@
"
./...
)
This diff is collapsed.
Click to expand it.
compress.go
+
13
−
13
View file @
9fdcb5d7
...
@@ -23,19 +23,6 @@ const (
...
@@ -23,19 +23,6 @@ const (
// This is the default. Do not enable compression without benchmarking for your particular use case first.
// This is the default. Do not enable compression without benchmarking for your particular use case first.
CompressionDisabled
CompressionMode
=
iota
CompressionDisabled
CompressionMode
=
iota
// CompressionNoContextTakeover compresses each message greater than 512 bytes. Each message is compressed with
// a new 1.2 MB flate.Writer pulled from a sync.Pool. Each message is read with a 40 KB flate.Reader pulled from
// a sync.Pool.
//
// This means less efficient compression as the sliding window from previous messages will not be used but the
// memory overhead will be lower as there will be no fixed cost for the flate.Writer nor the 32 KB sliding window.
// Especially if the connections are long lived and seldom written to.
//
// Thus, it uses less memory than CompressionContextTakeover but compresses less efficiently.
//
// If the peer does not support CompressionNoContextTakeover then we will fall back to CompressionDisabled.
CompressionNoContextTakeover
// CompressionContextTakeover compresses each message greater than 128 bytes reusing the 32 KB sliding window from
// CompressionContextTakeover compresses each message greater than 128 bytes reusing the 32 KB sliding window from
// previous messages. i.e compression context across messages is preserved.
// previous messages. i.e compression context across messages is preserved.
//
//
...
@@ -48,6 +35,19 @@ const (
...
@@ -48,6 +35,19 @@ const (
//
//
// If the peer does not support CompressionContextTakeover then we will fall back to CompressionNoContextTakeover.
// If the peer does not support CompressionContextTakeover then we will fall back to CompressionNoContextTakeover.
CompressionContextTakeover
CompressionContextTakeover
// CompressionNoContextTakeover compresses each message greater than 512 bytes. Each message is compressed with
// a new 1.2 MB flate.Writer pulled from a sync.Pool. Each message is read with a 40 KB flate.Reader pulled from
// a sync.Pool.
//
// This means less efficient compression as the sliding window from previous messages will not be used but the
// memory overhead will be lower as there will be no fixed cost for the flate.Writer nor the 32 KB sliding window.
// Especially if the connections are long lived and seldom written to.
//
// Thus, it uses less memory than CompressionContextTakeover but compresses less efficiently.
//
// If the peer does not support CompressionNoContextTakeover then we will fall back to CompressionDisabled.
CompressionNoContextTakeover
)
)
func
(
m
CompressionMode
)
opts
()
*
compressionOptions
{
func
(
m
CompressionMode
)
opts
()
*
compressionOptions
{
...
...
This diff is collapsed.
Click to expand it.
make.sh
+
4
−
0
View file @
9fdcb5d7
...
@@ -2,7 +2,11 @@
...
@@ -2,7 +2,11 @@
set
-eu
set
-eu
cd
--
"
$(
dirname
"
$0
"
)
"
cd
--
"
$(
dirname
"
$0
"
)
"
echo
"=== fmt.sh"
./ci/fmt.sh
./ci/fmt.sh
echo
"=== lint.sh"
./ci/lint.sh
./ci/lint.sh
echo
"=== test.sh"
./ci/test.sh
"
$@
"
./ci/test.sh
"
$@
"
echo
"=== bench.sh"
./ci/bench.sh
./ci/bench.sh
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment