sourcegraph / srclib

srclib is a polyglot code analysis library, built for hackability. It consists of language analysis toolchains (currently for Go and Java, with Python, JavaScript, and Ruby in beta) with a common output format, and a CLI tool for running the analysis.
https://srclib.org
Other
942 stars 62 forks source link

perf: Query limit filter in unitstore.Refs #191

Closed keegancsmith closed 9 years ago

keegancsmith commented 9 years ago

If one of our filters is a limiter, then we can avoid querying additional unit stores if our limit is reached. On a large synthetic repo (500 units) this took query time from 15s to 6s. This was an FS backed store through sourcegraph on my MBA. The limit used is 2. Most of the 6s time is dominated by unmarshalling the index, rather than the queries.

slimsag commented 9 years ago

I'm only able to test on a repo of 200 units (not 500) but in my case it didn't help very much, taking the time from ~2.1s to ~1.9s. I presume this is the same thing I identified yesterday, which is that I am primarily IO bound. But it looks like this helped significantly for you on your MBA which I presume has an SSD.

LGTM