diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-01-12 13:07:14 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-01-12 13:07:14 -0400 |
commit | 4a474a6bf63b0cef088ad55624e24366bad25a5e (patch) | |
tree | 180f94b63f2ac14aa11466bfa29f7d8ea9deac06 /Database | |
parent | 17cf39db4fb4985ad1230417f537dadce8272d38 (diff) |
add FileKeyIndex to Keys db to optimize getAssociatedKey
This is a schema change so will break any existing keys databases. But,
it's not been released yet, so I'm still able to make such changes.
This speeds up the benchmark quite nicely:
benchmarking keys database/getAssociatedKey from 1000 (hit)
time 91.65 μs (91.48 μs .. 91.81 μs)
1.000 R² (1.000 R² .. 1.000 R²)
mean 91.78 μs (91.66 μs .. 91.94 μs)
std dev 468.3 ns (353.1 ns .. 624.3 ns)
benchmarking keys database/getAssociatedKey from 1000 (miss)
time 53.33 μs (53.23 μs .. 53.40 μs)
1.000 R² (1.000 R² .. 1.000 R²)
mean 53.43 μs (53.36 μs .. 53.53 μs)
std dev 274.2 ns (211.7 ns .. 361.5 ns)
benchmarking keys database/getAssociatedKey from 10000 (hit)
time 92.99 μs (92.74 μs .. 93.27 μs)
1.000 R² (1.000 R² .. 1.000 R²)
mean 92.90 μs (92.76 μs .. 93.16 μs)
std dev 608.7 ns (404.1 ns .. 963.5 ns)
benchmarking keys database/getAssociatedKey from 10000 (miss)
time 53.12 μs (52.91 μs .. 53.39 μs)
1.000 R² (0.999 R² .. 1.000 R²)
mean 52.84 μs (52.68 μs .. 53.16 μs)
std dev 715.4 ns (400.4 ns .. 1.370 μs)
Diffstat (limited to 'Database')
-rw-r--r-- | Database/Keys/SQL.hs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Database/Keys/SQL.hs b/Database/Keys/SQL.hs index 6862b15d9..79230b60d 100644 --- a/Database/Keys/SQL.hs +++ b/Database/Keys/SQL.hs @@ -28,6 +28,7 @@ Associated key SKey file FilePath KeyFileIndex key file + FileKeyIndex file key Content key SKey cache SInodeCache |