owned this note changed 2 months ago
Published Linked with GitHub

2015-04-16

Lukas put a PR

rust-analyzer

  • more memory usage complaints
  • (an aside about facebook's metrics)
  • talking about infer; overhead of memoization
    • should be able to drop Arcs in rust-analyzer and just use a tracked struct's tracked fields

Discussion about how to replace "firewall" queries:

#[salsa::tracked]
struct TraitImpl {
	trait_name: String, // part of the identity

	#[tracked]
	where_clauses: Vec<WhereClause>, // tracked field
}

fn outer() {
	let data = get_implementations(); // this would be green if the same set of tracked structs are created
	// only red if: a change to an untracked field
	
	for s in data {
		do_something(s); // these would re-execute if they read from a red tracked field
	}
}

fn get_implementations() -> Vec<TraitImpl> {
	.....
}

// the query contents in rust-analyzer today:
pub struct TraitImpls {
    // If the `Option<TyFingerprint>` is `None`, the impl may apply to any self type.
    map: FxHashMap<TraitId, FxHashMap<Option<TyFingerprint>, Box<[ImplId]>>>,
}
Select a repo