Stream: platform development

Topic: 100 % CPU when calling `roc run` on a go platform


view this post on Zulip Oskar Hahn (Jan 05 2025 at 12:00):

I have a strange behavior. I am creating a go platform. When I call

roc run examples/hello_world/main.roc

It works, but it also takes 100 % cpu, even when it idles.

When I build the binary with roc build examples/hello_world/main.roc (with or without --optimize) or I use roc run examples/hello_world/main.roc --optimize, it has a normal cpu usage.

I changed the host, so that it never calls into Roc, and it is the same behavior. 100% CPU when calling with roc run, no CPU, when building first or running with --optimize.

Switching the linker between surgical or legacy does not change anything.

I don't know, how to narrow the error down. Do you have any idea, what could cause it?

view this post on Zulip Jasper Woudenberg (Jan 05 2025 at 12:15):

Some investigation into this problem in this thread:
#platform development > roc runtime continues using CPU after platform code is done @ 💬

view this post on Zulip Oskar Hahn (Jan 05 2025 at 17:43):

Ahh. Thank you. I missed that.

What I don't get is, why does this error not happen on basic-webserver?


Last updated: Jul 06 2025 at 12:14 UTC