go-timer icon indicating copy to clipboard operation
go-timer copied to clipboard

Why is faster than standard library?

Open madewithmind opened this issue 2 years ago • 3 comments

Any benchmark and proof?

madewithmind avatar Jul 16 '23 15:07 madewithmind

😀 Benchmarks are working in progress, according my historical tests, when goroutines expand about to 5k-1w, the lib has a lesser time diff and lesser resources usage. The performance consideration is partial reason to create the lib, mostly to provide some easier method and patterns for async handler scene. If you are interested about it, welcome to PR for tests or features.

singchia avatar Jul 24 '23 02:07 singchia

只是相对于标准库少了一些NewTimer和NewTicker的调用。如果对精度有要求,比如10ms或者1ms.这种。定时任务量大可以用,因为Timer的调用量固定. 否则感觉有点鸡肋。始终没解决linux下time.Timer的高CPU使用

FJSDS avatar Aug 03 '23 01:08 FJSDS

@FJSDS 我自己是放在C10K/M的场景使用的,心跳、同步这些,量级会大一些

singchia avatar Sep 01 '23 03:09 singchia