9 Commits
Author SHA1 Message Date
xtaci fd709b14a3 docs: fix typos and improve comments across secondary files
- pkg.go: fix grammar in package doc (intents→intends, aims→aim,
  golang→Go)
- snmp.go: fix typos (iput→input); clarify FECShardSet and
  FECShardMin field descriptions
- kcp_trace_off.go: fix typo (ingore→no-op)
- readloop_linux.go: improve readLoop doc comment; document batchSize
  constant
- tx_linux.go: improve tx() doc comment
- entropy.go: document reseedInterval constant

No code logic changes. Comments and documentation only.
2026-03-13 17:09:45 +08:00
xtaci 2693fa8e71 perf: reduce heap allocations and fix memory leaks across multiple components
Optimizations:
- ringbuffer: optimize Len(), IsEmpty(), Discard(), Clear() methods with
  branchless arithmetic and simplified logic
- fec: fix memory leak in shardHeap.Pop() by setting element to nil before
  truncating slice, preventing GC from holding stale references
- timedsched: fix memory leak in timedFuncHeap.Pop() with same nil-before-truncate
  pattern; optimize prepend() using slice swap instead of append
- autotune: add sortCache field to Autotuner to reuse slice allocation in
  FindPeriod(), avoiding repeated allocations during period detection
- snmp: replace fmt.Sprint with strconv.FormatUint for better performance
  in Copy() and Reset() methods
- entropy: remove defer overhead in rngAES.Read() and rngChacha8.Read()
  hot paths for reduced function call cost
- bufferpool: pre-allocate ErrBufferPoolSizeExceeded error; reset slice
  length on Put() to allow proper reuse
- sess: remove defer overhead in 6 setter methods (SetWriteDelay,
  SetWindowSize, SetStreamMode, SetACKNoDelay, SetDUP, SetNoDelay)

These changes reduce memory allocations, fix potential memory leaks in
heap-based data structures, and eliminate defer overhead in frequently
called methods.
2026-01-29 12:22:33 +08:00
xtaci 69601c5a59 Merge branch 'rbqvq-nonce' 2025-12-10 13:36:20 +08:00
Coia Prant d58f562e75 chores: use global entropy & add chacha8 2025-12-10 12:26:31 +08:00
xtaci 3040333ea6 adjust comments 2024-07-27 21:54:02 +08:00
xtaci 3653cc9fea add license to source codes 2024-07-25 21:35:37 +08:00
xtaci 2500c38813 lint 2018-12-27 15:05:38 +08:00
xtaci 9c319c3ee8 add AES128 based nonce generator 2018-09-16 23:55:04 +08:00
xtaci 3cecde5a0d rename file 2018-09-13 23:41:25 +08:00