Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
time: Tick docs don't mention CPU cost of "leaks" #17757
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
While you're technically right that "leak" could mean any resource, that's not the popular definition of leaks. Doing a Google search for [memory leak] shows 4.2M results. Doing a google search for [resource leak] and [cpu leak] show 370K and 660K results, respectively -- tiny in comparison to the former. Most developers would read these lines and come out thinking the doc is purely about memory leak. Anecdotal evidence:
And memory leak makes sense. It's a common problem with C++ programs, and when GC can't reach something, memory leaking is already expected and quickly assumed. Typically, these leaking structures are passive, and they just lie around consuming only memory; but timer is not a passive structure. It's actively consuming CPU cycles, easily using up an entire core due to a nonchalant use of this wrapper function.
And therein lies the confusion. I think we should trade clarity over a technicality, and outright mention the more significant adverse effect, which is CPU consumption caused by a fast iterating loop using this wrapper function.