salsa-rs / salsa

A generic framework for on-demand, incrementalized computation. Inspired by adapton, glimmer, and rustc's query system.
https://salsa-rs.netlify.app/
Apache License 2.0
2.09k stars 142 forks source link

Struct field ingredients #481

Closed nikomatsakis closed 5 months ago

nikomatsakis commented 5 months ago

This branch overhauls how tracked structs are implemented to make them more efficient -- it also adds tests for some edge cases along the way. In the new design, instead of treating tracked structs like a bunch of functions with specified values (omg the hashing) it creates a single shared hashmap to map the tracked struct id to its fields.

The plan is to eventually transition to a "Salsa 3.0" design in which tracked structs can be literal pointers into this shared value, but that will require more extensive changes that I have to write-up and think through (there are some edge cases in the unsafe code that are a bit subtle). This seemed like a useful stopping point regardless.

netlify[bot] commented 5 months ago

Deploy Preview for salsa-rs canceled.

Name Link
Latest commit 877296157366c627f3acda10c692be82136d8f07
Latest deploy log https://app.netlify.com/sites/salsa-rs/deploys/660be6779be8c20008312875