Skip to content

Commit

Permalink
Updating test specification to improve speeds
Browse files Browse the repository at this point in the history
  • Loading branch information
ShivanshVij committed Mar 26, 2024
1 parent f9dfd9b commit 48086fa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.22"
check-latest: true
cache: true
- name: Run Tests
Expand All @@ -20,11 +20,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.22"
check-latest: true
cache: true
- name: Test with Race Conditions
Expand All @@ -34,11 +34,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.22"
check-latest: true
cache: true
- name: Benchmark
Expand All @@ -47,11 +47,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.22"
check-latest: true
cache: true
- name: Benchmark with Race Conditions
Expand Down
7 changes: 4 additions & 3 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,11 +459,12 @@ func (s *Server) serveConn(newConn net.Conn) {
if s.ConnContext != nil {
connCtx = s.ConnContext(connCtx, frisbeeConn)
}
if s.concurrency == 0 {
switch s.concurrency {
case 0:
s.handleUnlimitedPacket(frisbeeConn, connCtx)
} else if s.concurrency == 1 {
case 1:
s.handleSinglePacket(frisbeeConn, connCtx)
} else {
default:
s.handleLimitedPacket(frisbeeConn, connCtx)
}
s.connectionsMu.Lock()
Expand Down

0 comments on commit 48086fa

Please sign in to comment.