Skip to content

Commit

Permalink
Auto merge of #78452 - cjgillot:ddk-struct, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Access query (DepKind) metadata through fields

This refactors the access to query definition metadata (attributes such as eval always, anon, has_params) and loading/forcing functions to generate a number of structs, instead of matching on the DepKind enum. This makes access to the fields cheaper to compile. Using a struct means that finding the metadata for a given query is just an offset away; previously the match may have been compiled to a jump table but likely not completely inlined as we expect here.

A previous attempt explored a similar strategy, but using trait objects in #78314 that proved less effective, likely due to higher overheads due to forcing dynamic calls and poorer cache utilization (all metadata is fairly densely packed with this PR).
  • Loading branch information
bors committed Jan 8, 2021
2 parents ddf2cc7 + 0f334c3 commit 26438b4
Show file tree
Hide file tree
Showing 6 changed files with 376 additions and 317 deletions.
Loading

0 comments on commit 26438b4

Please sign in to comment.