]> git.lizzy.rs Git - rust.git/commit
cache chalk queries
authorAleksey Kladov <aleksey.kladov@gmail.com>
Wed, 26 Jun 2019 09:54:13 +0000 (12:54 +0300)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Wed, 26 Jun 2019 09:54:13 +0000 (12:54 +0300)
commita198d78bd1dafbfe78c597ff0deab17ac4d9092e
treecda79197641d6c78268d1badf2e52334abffa3c3
parentfc0f4ed6353174eb80229571e3e54993b1605e41
cache chalk queries

This gives a significant speedup, because chalk will call these
functions several times even withing a single revision. The only
significant one here is `impl_data`, but I figured it might be good to
cache others just for consistency.

The results I get are:

Before:

from scratch:   16.081457952s
no change:      15.846493ms
trivial change: 352.95592ms
comment change: 361.998408ms
const change:   457.629212ms

After:

from scratch:   14.910610278s
no change:      14.934647ms
trivial change: 85.633023ms
comment change: 96.433023ms
const change:   171.543296ms

Seems like a nice win!
crates/ra_hir/src/db.rs
crates/ra_hir/src/ty/traits.rs
crates/ra_hir/src/ty/traits/chalk.rs