good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit 9fdcb5d7 authored by Anmol Sethi's avatar Anmol Sethi
Browse files

Misc fixes

parent fb3b083e
Branches
Tags
No related merge requests found
# websocket # websocket
[![godoc](https://godoc.org/nhooyr.io/websocket?status.svg)](https://pkg.go.dev/nhooyr.io/websocket) [![godoc](https://godoc.org/nhooyr.io/websocket?status.svg)](https://pkg.go.dev/nhooyr.io/websocket)
[![coverage](https://img.shields.io/badge/coverage-86%25-success)](https://nhooyrio-websocket-coverage.netlify.app) [![coverage](https://img.shields.io/badge/coverage-89%25-success)](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.
......
...@@ -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 "$@" ./...
)
...@@ -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 {
......
...@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment