Stream: announcements

Topic: List Refcounting Performance Fixes


view this post on Zulip Brendan Hansknecht (Jul 14 2024 at 02:45):

Hi all,

#6894 has just been merged! It fixes a major performance issue in Roc related to lists of refcounted things (e.g. List Str, Dict Str I64, List (List U8), Set Str, etc). This PR can lead to code executing multiple 1000s of times faster by skipping O(n) refcounting of all list elements.

For the most part, this change won't break anything. That said, platform effects that use lists of refcounted things will likely break until the platforms are updated. For example, Dir.list in basic cli. So just a warning if you build from source on main.

For those who just use nightlies, the plan is to skip a few nightlies as we merge a few other breaking changes and get all the core platforms up to date. So you won't see the benefits of this change for a bit.

Otherwise, if you notice any crashes or memory leaks, please let us know.

Enjoy the perf gains!

view this post on Zulip Oskar Hahn (Jul 14 2024 at 06:35):

This sounds fantastic.

I don't understand, what exactly I have to do as a platform author. For example, here is the Go-code, which handles Roc lists: https://github.com/lukewilliamboswell/roc-glue-code-gen/blob/main/package/go-builtins/roc_std.go

Is there an explanation, how the new refcounting works?

view this post on Zulip Luke Boswell (Jul 14 2024 at 06:39):

I was thinking about sharing this video -- Brendan gave an awesome overview in a previous online meetup, here is the link to the time

view this post on Zulip Oskar Hahn (Jul 14 2024 at 09:26):

Thx. This will help to get started


Last updated: Jul 26 2025 at 12:14 UTC