sharded-gotify/api/stream
昨夜雨疏风骤 4bc42d2c1d
Optimize uniq function for better performance (#852)
Improve the performance of the unique function by:
1. Pre-allocating map capacity with len(s) to avoid frequent map resizing
2. Pre-allocating result slice capacity with len(s) to reduce append overhead
3. Reducing the number of traversals performs well under the condition of a large number of elements

These changes maintain the original behavior (preserving element order) 
while reducing memory allocation operations, especially effective for 
large slices (100k+ elements) with benchmark showing ~25% speedup.

No breaking changes, the function signature and output order remain unchanged.
2025-10-03 01:17:47 +00:00
..
client.go Use golangci-lint 2020-11-01 10:47:02 +01:00
once.go Format all go files 2019-01-01 23:34:42 +01:00
once_test.go Add once test 2018-11-22 20:59:29 +01:00
stream.go Optimize uniq function for better performance (#852) 2025-10-03 01:17:47 +00:00
stream_test.go Fix stream_test flakiness 2023-08-06 12:30:22 +02:00