aboutsummaryrefslogtreecommitdiff
path: root/stackless
AgeCommit message (Collapse)AuthorFilesLines
2024-03-02Enable perfsprint linter; fix up lint issues (#1727)Gravatar Oleksandr Redko 1-3/+3
2023-11-24chore: Use 'any' instead of 'interface{}' (#1666)Gravatar Oleksandr Redko 4-11/+11
gofmt -w -r "interface{} -> any" -l .
2023-11-12Lazy load stackless functions (#1656)Gravatar Gusted 1-1/+12
- I noticed that fasthttp was taking up 1.8MB of heap memory, even though it wasn't being used. This turned out to be the stackless function: 1.80MB github.com/valyala/fasthttp/stackless.NewFunc - Lazy load the stackless functions with sync.Once, given this a simple atomic read, it shouldn't affect performance for the fast-path (I haven't seen benchmarks with compression enabled).
2023-03-30get rid of some panics (#1526)Gravatar Moritz Poldrack 1-0/+1
* client: simplify (*HostClient).do() Remove an allocation in favour of deferring a call to release the response. * client: remove panic in dialAddr Return an error instead of panicking if the user supplied a nonsensical DialFunc. * compression: remove panic on invalid compression level If a compression level exceeding gzip's boundaries is provided, fasthttp will panic. Instead it would be better to handle this error for them by limiting it to the minimum or maximum value, depending on the direction the user has exceeded the limits. Clamp the value of gzip to always be between gzip.BestSpeed and gzip.BestCompression. * peripconn: remove panic on negative connection count When a negative count is reached when unregistering a connection, a panic is caused even though data-integrity is not at risk. Replace the panic() with a simple clamp on the value to ensure the value does not exceed it's expected lower bounds. References: #1504 * compress: remove error on failed nonblocking writes Since there is no way of handling or even logging non-critical errors in stateless non-blocking writecalls, just drop them and hope the user notices and tries again. * workerPool: remove panic on redundant Start and Stop calls Instead of panicking for invalid behaviour, it's preferable to just turn the function into a noop. * http: remove panic on invalid form boundary * http: remove panic on negative reads Since bufio already panics on negative reads, it is not necessary to do so as well. If the length is zero and for some reason no error is returned, readBodyIdentity and appendBodyFixedSize now errors in these cases. Link: https://github.com/golang/go/blob/851f6fd61425c810959c7ab51e6dc86f8a63c970/src/bufio/bufio.go#L246 * fs: remove panic on negative reader count When a negative count is reached when unregistering a reader, a panic is thrown even though data-integrity is not at risk. Replace the panic() with a simple clamp on the value to ensure the value does not exceed it's expected lower bounds. * server: remove panic in favour of a segfault Panicking with "BUG: " obscures the error. As the segfault causes a panic anyway, just let the chaos unfold. * server: remove panic in favour of returning an error Writing on a timed-out response is not endangering data integrity and just fails. * chore: add comments to all panics * chore: fix minor typo
2023-02-09doc,test: correct typos (#1484)Gravatar Oleksandr Redko 1-2/+2
2022-09-15Deprecate Go 1.15 (#1379)Gravatar Aoang 1-2/+1
* Dropping support for 1.15. * Replaces Go 1.16 Deprecated functions * Update test build flag * Fix import sort and comment * Update github.com/klauspost/compress to v1.15.9 https://github.com/klauspost/compress improved performance and changed Minimum version is 1.16, this should be the final supported release for Go 1.16 (https://github.com/klauspost/compress/commit/6d0019a95afa3221f7522d1f2eed0033b5e79470) .
2022-08-14Add Go 1.19 Support (#1355)v1.39.0Gravatar Aoang 1-3/+3
* Update Go Version to Go1.19.x And add cache * Fix CI Line endings * Update test CI Go Version to Go1.19.x And add cache * Update Gosec Security Scanner CI to securego/gosec@v2.12.0 * Format comment Go 1.19 adds support for links, lists, and clearer headings in doc comments. As part of this change, gofmt now reformats doc comments to make their rendered meaning clearer. See “Go Doc Comments” for syntax details and descriptions of common mistakes now highlighted by gofmt. As another part of this change, the new package go/doc/comment provides parsing and reformatting of doc comments as well as support for rendering them to HTML, Markdown, and text. ref: https://tip.golang.org/doc/go1.19 ref: https://tip.golang.org/doc/comment * Fix doc structure
2022-04-01Use %v for errors and %q for strings (#1262)v1.35.0Gravatar Erik Dubbelboer 2-8/+8
Mostly in tests.
2021-12-13Use %w to wrap errors (#1175)Gravatar Erik Dubbelboer 1-4/+4
2021-06-18Lower go test timeGravatar Erik Dubbelboer 2-0/+12
2019-11-16Run golangci-lint using a Github ActionGravatar Erik Dubbelboer 1-3/+2
2019-10-23Format errors (#679)Gravatar ZhangYunHao 1-1/+1
* format errors * Server is a type name * Fix typo
2018-08-12ci, reuseport, writer: update travis config and goimports -w on whole projectGravatar Kirill Danshin 1-1/+2
Signed-off-by: Kirill Danshin <kirill@danshin.pro>
2017-02-06stackless: use dedicated worker pool per each stackless func.Gravatar Aliaksandr Valialkin 2-16/+15
This reduces tail latencies in our prod when multiple stackless funcs are used concurrently.
2017-02-06stackless: send "func done" notification over a buffered channel, so the ↵Gravatar Aliaksandr Valialkin 1-1/+1
funcWorker could process multiple work items without switching to other goroutines
2017-02-05stackless: added NewFunc() for wrapping stack-hungry CPU-bound functionsGravatar Aliaksandr Valialkin 5-38/+236
2016-11-11stackless: optimization: do not issue zero-length writes to underlying writerGravatar Aliaksandr Valialkin 2-4/+4
2016-11-03Reduce stack space usage when using response compressionGravatar Aliaksandr Valialkin 3-0/+271