Commits on Source 88
-
Kunal Singh authored
-
Anmol Sethi authored
Change protocol in docs and logs from http to ws
-
wdvxdr authored
goos: windows goarch: amd64 pkg: nhooyr.io/websocket cpu: Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz Benchmark_mask/2/basic-8 425339004 2.795 ns/op 715.66 MB/s Benchmark_mask/2/nhooyr-8 379937766 3.186 ns/op 627.78 MB/s Benchmark_mask/2/gorilla-8 392164167 3.071 ns/op 651.24 MB/s Benchmark_mask/2/gobwas-8 310037222 3.880 ns/op 515.46 MB/s Benchmark_mask/3/basic-8 321408024 3.806 ns/op 788.32 MB/s Benchmark_mask/3/nhooyr-8 350726338 3.478 ns/op 862.58 MB/s Benchmark_mask/3/gorilla-8 332217727 3.634 ns/op 825.43 MB/s Benchmark_mask/3/gobwas-8 247376214 4.886 ns/op 614.01 MB/s Benchmark_mask/4/basic-8 261182472 4.582 ns/op 872.91 MB/s Benchmark_mask/4/nhooyr-8 381830712 3.262 ns/op 1226.05 MB/s Benchmark_mask/4/gorilla-8 272616304 4.395 ns/op 910.04 MB/s Benchmark_mask/4/gobwas-8 204574558 5.855 ns/op 683.19 MB/s Benchmark_mask/8/basic-8 191330037 6.162 ns/op 1298.24 MB/s Benchmark_mask/8/nhooyr-8 369694992 3.285 ns/op 2435.65 MB/s Benchmark_mask/8/gorilla-8 175388466 6.743 ns/op 1186.48 MB/s Benchmark_mask/8/gobwas-8 241719933 4.886 ns/op 1637.45 MB/s Benchmark_mask/16/basic-8 100000000 10.92 ns/op 1464.83 MB/s Benchmark_mask/16/nhooyr-8 272565096 4.436 ns/op 3606.98 MB/s Benchmark_mask/16/gorilla-8 100000000 11.20 ns/op 1428.53 MB/s Benchmark_mask/16/gobwas-8 221356798 5.405 ns/op 2960.45 MB/s Benchmark_mask/32/basic-8 61476984 20.40 ns/op 1568.80 MB/s Benchmark_mask/32/nhooyr-8 238665572 5.050 ns/op 6337.22 MB/s Benchmark_mask/32/gorilla-8 100000000 12.09 ns/op 2647.28 MB/s Benchmark_mask/32/gobwas-8 186077235 6.477 ns/op 4940.36 MB/s Benchmark_mask/128/basic-8 14629720 80.90 ns/op 1582.19 MB/s Benchmark_mask/128/nhooyr-8 181241968 6.565 ns/op 19497.98 MB/s Benchmark_mask/128/gorilla-8 68308342 16.76 ns/op 7639.37 MB/s Benchmark_mask/128/gobwas-8 94582026 12.97 ns/op 9872.11 MB/s Benchmark_mask/512/basic-8 3921001 305.6 ns/op 1675.55 MB/s Benchmark_mask/512/nhooyr-8 123102199 9.721 ns/op 52669.11 MB/s Benchmark_mask/512/gorilla-8 32355914 38.18 ns/op 13411.43 MB/s Benchmark_mask/512/gobwas-8 31528501 37.80 ns/op 13544.37 MB/s Benchmark_mask/4096/basic-8 491804 2381 ns/op 1720.39 MB/s Benchmark_mask/4096/nhooyr-8 26159691 46.98 ns/op 87187.73 MB/s Benchmark_mask/4096/gorilla-8 4898440 243.6 ns/op 16817.89 MB/s Benchmark_mask/4096/gobwas-8 4336398 277.2 ns/op 14776.40 MB/s Benchmark_mask/16384/basic-8 113842 9623 ns/op 1702.66 MB/s Benchmark_mask/16384/nhooyr-8 8088847 154.5 ns/op 106058.18 MB/s Benchmark_mask/16384/gorilla-8 1282993 933.6 ns/op 17549.90 MB/s Benchmark_mask/16384/gobwas-8 997347 1086 ns/op 15093.49 MB/s We're about 4-5x faster then gorilla now.
-
Anmol Sethi authored
-
Anmol Sethi authored
Slower for some reason than just SIMD. Also no dependency on cpu package is nice.
-
Anmol Sethi authored
-
Anmol Sethi authored
-
Anmol Sethi authored
-
Anmol Sethi authored
-
Anmol Sethi authored
-
Anmol Sethi authored
-
Anmol Sethi authored
-
Anmol Sethi authored
-
Anmol Sethi authored
-
Anmol Sethi authored
json.Encoder is 42% faster than json.Marshal thanks to the memory reuse. goos: linux goarch: amd64 pkg: nhooyr.io/websocket/wsjson cpu: 12th Gen Intel(R) Core(TM) i5-1235U BenchmarkJSON/json.Encoder-12 3517579 340.2 ns/op 24 B/op 1 allocs/op BenchmarkJSON/json.Marshal-12 2374086 484.3 ns/op 728 B/op 2 allocs/op Closes #409
-
Anmol Sethi authored
-
Anmol Sethi authored
-
Anmol Sethi authored
[qrvnl@dios ~/src/websocket] 130$ go test -bench=. ./wsjson/ goos: linux goarch: amd64 pkg: nhooyr.io/websocket/wsjson cpu: 12th Gen Intel(R) Core(TM) i5-1235U BenchmarkJSON/json.Encoder/8-12 14041426 72.59 ns/op 110.21 MB/s 16 B/op 1 allocs/op BenchmarkJSON/json.Encoder/16-12 13936426 86.99 ns/op 183.92 MB/s 16 B/op 1 allocs/op BenchmarkJSON/json.Encoder/32-12 11416401 115.3 ns/op 277.59 MB/s 16 B/op 1 allocs/op BenchmarkJSON/json.Encoder/128-12 4600574 264.7 ns/op 483.55 MB/s 16 B/op 1 allocs/op BenchmarkJSON/json.Encoder/256-12 2710398 433.9 ns/op 590.06 MB/s 16 B/op 1 allocs/op BenchmarkJSON/json.Encoder/512-12 1588930 717.3 ns/op 713.82 MB/s 16 B/op 1 allocs/op BenchmarkJSON/json.Encoder/1024-12 823138 1484 ns/op 689.80 MB/s 16 B/op 1 allocs/op BenchmarkJSON/json.Encoder/2048-12 402823 2875 ns/op 712.32 MB/s 16 B/op 1 allocs/op BenchmarkJSON/json.Encoder/4096-12 213926 5602 ns/op 731.14 MB/s 16 B/op 1 allocs/op BenchmarkJSON/json.Encoder/8192-12 92864 11281 ns/op 726.19 MB/s 16 B/op 1 allocs/op BenchmarkJSON/json.Encoder/16384-12 39318 29203 ns/op 561.04 MB/s 19 B/op 1 allocs/op BenchmarkJSON/json.Marshal/8-12 10768671 114.5 ns/op 69.89 MB/s 48 B/op 2 allocs/op BenchmarkJSON/json.Marshal/16-12 10140996 113.9 ns/op 140.51 MB/s 64 B/op 2 allocs/op BenchmarkJSON/json.Marshal/32-12 9211780 121.6 ns/op 263.06 MB/s 64 B/op 2 allocs/op BenchmarkJSON/json.Marshal/128-12 4632796 264.2 ns/op 484.53 MB/s 224 B/op 2 allocs/op BenchmarkJSON/json.Marshal/256-12 2441511 473.5 ns/op 540.65 MB/s 432 B/op 2 allocs/op BenchmarkJSON/json.Marshal/512-12 1298788 896.2 ns/op 571.27 MB/s 912 B/op 2 allocs/op BenchmarkJSON/json.Marshal/1024-12 602084 1866 ns/op 548.83 MB/s 1808 B/op 2 allocs/op BenchmarkJSON/json.Marshal/2048-12 341151 3817 ns/op 536.61 MB/s 3474 B/op 2 allocs/op BenchmarkJSON/json.Marshal/4096-12 175594 7034 ns/op 582.32 MB/s 6548 B/op 2 allocs/op BenchmarkJSON/json.Marshal/8192-12 83222 15023 ns/op 545.30 MB/s 13591 B/op 2 allocs/op BenchmarkJSON/json.Marshal/16384-12 33087 39348 ns/op 416.39 MB/s 27304 B/op 2 allocs/op PASS ok nhooyr.io/websocket/wsjson 32.934s
-
Anmol Sethi authored
-
Anmol Sethi authored
-
Anmol Sethi authored
-
Anmol Sethi authored
-
Anmol Sethi authored
-
Anmol Sethi authored
I'm just not good enough at assembly. I added tests to confirm that @wdvxdr's implementation works correctly and matches the output of the basic masking loop.
-
Anmol Sethi authored
-
Anmol Sethi authored
Standard library does this too. Unfortunate wish they just exposed it in the standard library. Perhaps we can isolate the specific code we need later.
-
Anmol Sethi authored
-
Quinn Rivenwell authored
use simd masking for amd64&arm64
-
Grigorii Khvatskii authored
On some 32-bit architectures, 64-bit atomic operations panic when the value is not aligned properly. In this package, this causes netConn operations to panic when compiling with GOARCH=386, since netConn does atomic operations with int64 values in the netConn struct (namely, with readExpired and writeExpired). This commit fixes this by moving readExpired and writeExpired to the beginning of the struct, which makes them properly aligned.
-
Anmol Sethi authored
-
Anmol Sethi authored
-
Anmol Sethi authored
Fix unaligned load error on 32-bit architectures Closes #432
-
Alexander Wang authored
-
Anmol Sethi authored
Not ideal but whatever, I'm going to rewrite all of this anyway.
-
Anmol Sethi authored
Far simpler now. Sorry this took a while. Closes #427 Closes #429 Closes #434 Closes #436 Closes #437
-
Anmol Sethi authored
-
Anmol Sethi authored
-
Anmol Sethi authored
See #326
-
Anmol Sethi authored
-
Anmol Sethi authored
Context can be cancelled by parent. Doesn't indicate the CloseRead goroutine has exited.
-
Quinn Rivenwell authored
fix closenow race
-
Anmol Sethi authored
-
Anmol Sethi authored
-
Anmol Sethi authored
-
Jacob authored
This is a cleaner solution for the fix in #438 thanks to the fact that Go 1.19 now is the default and the atomic.Int64 types are automatically aligned correctly on 32 bit systems. Using this also means that xsync.Int64 can be removed. The new atomic.Int64 type solves the issue and should be quite a lot faster as it avoids the interface conversion.
-
Jacob authored
-
Quinn Rivenwell authored
Use new atomic types from Go 1.19
-
Ammar Bandukwala authored
This will create easily solved breakage on updates but I figure it's best to pull the band aid off as early as possible
-
Ammar Bandukwala authored
vulncheck was using slices which is only in newer Go versions.
-
Ammar Bandukwala authored
Update import path to github.com/coder/websocket
-
Ammar Bandukwala authored
-
Ammar Bandukwala authored
Add transfer notice to README
-
Mathias Fredriksson authored
-
Mathias Fredriksson authored
Fix coverage
-
Mathias Fredriksson authored
-
Mathias Fredriksson authored
Add setup-go to static.yml
-
Mathias Fredriksson authored
-
Mathias Fredriksson authored
Split coverage and deploy jobs in static.yml to avoid env issue
-
Mathias Fredriksson authored
-
Mathias Fredriksson authored
Clean out env passed to wasmbrowsertest in TestWasm
-
Mathias Fredriksson authored
This reverts commit 0f14077d.
-
Mathias Fredriksson authored
Revert "Split coverage and deploy jobs in static.yml to avoid env issue"
-
Mathias Fredriksson authored
-
Mathias Fredriksson authored
Sunset the dev branch
-
Kian Yang Lee authored
OS-specific behaviour is not necessary. This PR replaces filepath.Match with path.Match and also updated the documentation to reflect that. Closes #451
-
bestgopher authored
Signed-off-by:
bestgopher <84328409@qq.com>
-
Mathias Fredriksson authored
Since we rely on the connection not being hijacked too early (i.e. detecting the presence of http.Hijacker) to set headers, we must manually implement the unwrapping of the http.ResponseController. By doing so, we also retain Go 1.19 compatibility without build tags. Closes #455
-
Muhammad Atif Ali authored
* chore: prevent ci from running twice on PRs Now CI will only run on push to `master` and PRs to `master`. Previously, it was running twice on each push to a PR branch, once for the PR to `master` and once for pushing to the PR branch.
-
Muhammad Atif Ali authored
-
dependabot[bot] authored
build(deps): bump golang.org/x/time in /internal/examples Bumps [golang.org/x/time](https://github.com/golang/time) from 0.3.0 to 0.6.0. - [Commits](https://github.com/golang/time/compare/v0.3.0...v0.6.0 ) --- updated-dependencies: - dependency-name: golang.org/x/time dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by:
dependabot[bot] <support@github.com> Co-authored-by:
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
-
Mathias Fredriksson authored
Contributes to #474
-
Mathias Fredriksson authored
-
Mathias Fredriksson authored
-
Chun-Hung Tseng authored
Fix typo in chat_test.go Co-authored-by:
Mathias Fredriksson <mafredri@gmail.com>
-
Mathias Fredriksson authored
-
dependabot[bot] authored
Co-authored-by:
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
-
Moritz authored
Co-authored-by:
Mathias Fredriksson <mafredri@gmail.com>
-
Iñigo Garcia Olaizola authored
Fixes #512
-
Iñigo Garcia Olaizola authored
-
W. Michael Petullo authored
-
Iñigo Garcia Olaizola authored
This change adds two optional callbacks to both `DialOptions` and `AcceptOptions`. These callbacks are invoked synchronously when a ping or pong frame is received, allowing advanced users to log or inspect payloads for metrics or debugging. If the callback needs to perform more complex work or reuse the payload outside the callback, it is recommended to perform processing in a separate goroutine. The boolean return value of `OnPingReceived` is used to determine if the subsequent pong frame should be sent. If `false` is returned, the pong frame is not sent. Fixes #246
-
Iñigo Garcia Olaizola authored
-
Mathias Fredriksson authored
-
Mathias Fredriksson authored
* build: update to Go 1.23 * ci: update tools
-
Mathias Fredriksson authored
-
Marcin Tojek authored
-
Jacob Alzén authored
* Use any instead of interface{} given Go > 1.18 * Minor tidies thanks to gofumpt * Run "go fix ./..." on the codebase * Apply a few modernisations suggested by gopls check * Remove unused parameter suggested by gopls check
Showing
- .github/FUNDING.yml 0 additions, 1 deletion.github/FUNDING.yml
- .github/dependabot.yml 24 additions, 0 deletions.github/dependabot.yml
- .github/workflows/ci.yml 22 additions, 10 deletions.github/workflows/ci.yml
- .github/workflows/daily.yml 23 additions, 11 deletions.github/workflows/daily.yml
- .github/workflows/static.yml 52 additions, 0 deletions.github/workflows/static.yml
- LICENSE.txt 1 addition, 1 deletionLICENSE.txt
- Makefile 18 additions, 0 deletionsMakefile
- README.md 30 additions, 23 deletionsREADME.md
- accept.go 30 additions, 9 deletionsaccept.go
- accept_test.go 77 additions, 3 deletionsaccept_test.go
- autobahn_test.go 8 additions, 9 deletionsautobahn_test.go
- ci/bench.sh 13 additions, 2 deletionsci/bench.sh
- ci/fmt.sh 11 additions, 6 deletionsci/fmt.sh
- ci/lint.sh 5 additions, 2 deletionsci/lint.sh
- ci/test.sh 14 additions, 1 deletionci/test.sh
- close.go 102 additions, 60 deletionsclose.go
- close_test.go 1 addition, 2 deletionsclose_test.go
- compress.go 4 additions, 3 deletionscompress.go
- compress_test.go 3 additions, 4 deletionscompress_test.go
- conn.go 54 additions, 59 deletionsconn.go
.github/FUNDING.yml
deleted
100644 → 0
.github/dependabot.yml
0 → 100644
.github/workflows/static.yml
0 → 100644
Makefile
0 → 100644