Files
server/api
昨夜雨疏风骤 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
..
2023-09-16 21:06:54 +02:00
2023-09-16 21:06:54 +02:00
2020-05-08 10:43:17 +02:00
2023-09-16 21:06:54 +02:00
2020-07-01 19:44:06 +02:00
2023-09-16 21:06:54 +02:00
2020-05-08 10:43:17 +02:00
2021-08-04 19:39:43 +02:00
2023-09-16 21:06:54 +02:00