Skip to content

mesa: improvements#760

Merged
pkova merged 11 commits intodevelopfrom
pkova/mesa-driver
Feb 13, 2025
Merged

mesa: improvements#760
pkova merged 11 commits intodevelopfrom
pkova/mesa-driver

Conversation

@pkova
Copy link
Copy Markdown
Collaborator

@pkova pkova commented Feb 12, 2025

This PR contains several big improvements to the mesa driver:

  • We don't allocate nouns all over the place anymore.
  • To enable the previous we don't use our HAMT anymore, instead we use a off-the-shelf hashtable.
  • We don't do individual malloc and free calls all over the place anymore. The allocations have been grouped into lifetimes each with their own memory arena.
  • We don't allocate at all when we don't need to.

As a result we go from around 15 megabytes/second to 190 megabytes/second bandwidth for localhost peeking on my macbook M2. Corresponding speeds between two terrible 1 cpu 2gb VM:s situated on the other sides of the Atlantic go from around 2 megabytes/s to 18 megabytes/s.

There is still room to optimize the speed of directed messaging but this is certainly good enough for an initial release. The main thing that's somewhat wonky still is the congestion control.

@pkova pkova requested a review from a team as a code owner February 12, 2025 15:38
Comment thread pkg/vere/io/mesa.c
c3_i rec_i = 2 * 1024 * 1024;
uv_recv_buffer_size((uv_handle_t*)&u3_Host.wax_u, &rec_i);

uv_send_buffer_size((uv_handle_t*)&u3_Host.wax_u, &rec_i);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like we should read the buffer sizes (setting rec_i = 0) before setting them, to make sure we're not shrinking them.

@pkova pkova merged commit 1d19a9d into develop Feb 13, 2025
@pkova pkova deleted the pkova/mesa-driver branch February 13, 2025 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants