Skip to content

High CPU usage when runtime idling #703

@Sleitnick

Description

@Sleitnick

I am noticing that CPU usage is maxing out a single core when no work is actually being performed. I noticed this for task.wait, process.run, and net.serve. They all use the uv library, so maybe that's a hint towards the underlying issue?

Example 1: task wait

local task = require("@lute/task")
task.wait(100000)

Example 2: sleep

local process = require("@std/process")
process.run({ "sleep", "100000" })

Example 3: net serve

local net = require("@lute/net")
net.serve({ port = 8080, handler = function() return "ok" end })

Running any of these examples results in a single core being pinged to around 100%.

Windows x86-64 (16 logic cores, so 6.25% represents one full core):
Image

Linux x86-64:
Image

I have not tested this on macos.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingruntimeWork in the C++ runtime portion of the code

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions