Commit graph

131 commits

Author SHA1 Message Date
cce0f88803 Merge pull request #135 from kortschak/mongo
Quieten go vet in mongo
2014-08-21 13:27:27 -04:00
kortschak
93c9814147 Quieten go vet in mongo 2014-08-21 19:33:00 +09:30
kortschak
08e47b4a9e Do tagger copying with less iteration
This makes minimal difference to the benchmarks in cayley_test.go (a
variable ±5% on the bigger cases).
2014-08-21 15:34:50 +09:30
a371155cd2 Fix linksto and zero-costs 2014-08-16 06:30:27 -04:00
e453385d5e explain logging and weight fixing 2014-08-16 05:19:16 -04:00
3b83845584 Merge pull request #1 from kortschak/b
Use cznic/b B+tree implementation in place of GoLLRB for memstore
2014-08-14 21:39:42 -04:00
8720e17d87 Merge hash pool in from master
Conflicts:
	graph/leveldb/triplestore.go
	graph/mongo/triplestore.go
2014-08-14 21:03:36 -04:00
de882b9f93 port hasher pool to leveldb 2014-08-14 20:47:55 -04:00
kortschak
c618e556f4 Merge branch 'log_database' into b
Comparison of b against GoLLRB (as at d5f020).

$ benchcmp gollrb.bench b-gen.bench
benchmark                                   old ns/op       new ns/op	delta
BenchmarkNamePredicate                      1631932         1409531	-13.63%
BenchmarkLargeSetsNoIntersection            190792654       63748682	-66.59%
BenchmarkVeryLargeSetsSmallIntersection     896154437       373475843	-58.32%
BenchmarkHelplessContainsChecker            20719182678     14078301640	-32.05%
BenchmarkNetAndSpeed                        32519019        20188665	-37.92%
BenchmarkKeanuAndNet                        18319247        15224988	-16.89%
BenchmarkKeanuAndSpeed                      30849568        18744134	-39.24%
BenchmarkKeanuOther                         105552525       107620648	+1.96%
BenchmarkKeanuBullockOther                  295395338       115193002	-61.00%

benchmark                                   old allocs     new allocs	delta
BenchmarkNamePredicate                      1339           1341	+0.15%
BenchmarkLargeSetsNoIntersection            22585          23632	+4.64%
BenchmarkVeryLargeSetsSmallIntersection     65776          69396	+5.50%
BenchmarkHelplessContainsChecker            1713541        2036316	+18.84%
BenchmarkNetAndSpeed                        17104          17240	+0.80%
BenchmarkKeanuAndNet                        15816          15855	+0.25%
BenchmarkKeanuAndSpeed                      16368          16493	+0.76%
BenchmarkKeanuOther                         30134          30634	+1.66%
BenchmarkKeanuBullockOther                  35510          36454	+2.66%

benchmark                                   old bytes     new bytes	delta
BenchmarkNamePredicate                      96162         96294	+0.14%
BenchmarkLargeSetsNoIntersection            1172356       1249872	+6.61%
BenchmarkVeryLargeSetsSmallIntersection     2810080       2992409	+6.49%
BenchmarkHelplessContainsChecker            89233264      104999088	+17.67%
BenchmarkNetAndSpeed                        1388793       1428110	+2.83%
BenchmarkKeanuAndNet                        1263145       1250079	-1.03%
BenchmarkKeanuAndSpeed                      1246956       1281546	+2.77%
BenchmarkKeanuOther                         2021312       2024727	+0.17%
BenchmarkKeanuBullockOther                  2671448       2742968	+2.68%

Conflicts:
	graph/memstore/triplestore.go
2014-08-15 10:17:52 +09:30
kortschak
737037a894 Experiment with sync.Pool 2014-08-14 19:03:55 +09:30
d2026ea271 fix mongo indexing name mismatch 2014-08-14 01:57:03 -04:00
f967b36f84 comments and concretized deltas 2014-08-14 01:24:39 -04:00
fe0569c9d4 merge with master 2014-08-13 23:03:07 -04:00
cfca7db47c Go style
My C++ programmer's disease was acting up.
2014-08-13 14:54:36 -04:00
03798bc4fa fix mongo hasher 2014-08-13 13:29:08 -04:00
104e7d110d fix leveldb (and speed up hasa) 2014-08-13 13:08:50 -04:00
kortschak
4a92ae9758 Merge branch 'log_database' into b
Conflicts:
	graph/memstore/iterator.go
	graph/memstore/triplestore.go
2014-08-13 17:15:11 +09:30
kortschak
d98ca99974 Merge branch 'master' into b
$ benchcmp gollrb.bench b-gen.bench
benchmark                                   old ns/op       new ns/op	delta
BenchmarkNamePredicate                      1369329         1444990	+5.53%
BenchmarkLargeSetsNoIntersection            72329029        64975716	-10.17%
BenchmarkVeryLargeSetsSmallIntersection     890824761       408784476	-54.11%
BenchmarkHelplessContainsChecker            35314797618     30673240485	-13.14%
BenchmarkNetAndSpeed                        19694146        19486797	-1.05%
BenchmarkKeanuAndNet                        15340756        15317415	-0.15%
BenchmarkKeanuAndSpeed                      17902709        18042030	+0.78%
BenchmarkKeanuOther                         53452058        50984817	-4.62%
BenchmarkKeanuBullockOther                  90827780        86536510	-4.72%

benchmark                                   old allocs     new allocs	delta
BenchmarkNamePredicate                      1339           1339		+0.00%
BenchmarkLargeSetsNoIntersection            22603          22674	+0.31%
BenchmarkVeryLargeSetsSmallIntersection     65787          65860	+0.11%
BenchmarkHelplessContainsChecker            1713541        1713669	+0.01%
BenchmarkNetAndSpeed                        17135          17146	+0.06%
BenchmarkKeanuAndNet                        15802          15802	+0.00%
BenchmarkKeanuAndSpeed                      16397          16396	-0.01%
BenchmarkKeanuOther                         30148          30149	+0.00%
BenchmarkKeanuBullockOther                  35542          35544	+0.01%

benchmark                                   old bytes     new bytes	delta
BenchmarkNamePredicate                      96226         95842		-0.40%
BenchmarkLargeSetsNoIntersection            1165914       119725	+2.69%
BenchmarkVeryLargeSetsSmallIntersection     2760072       2777798	+0.64%
BenchmarkHelplessContainsChecker            84388448      84351168	-0.04%
BenchmarkNetAndSpeed                        1414837       1425752	+0.77%
BenchmarkKeanuAndNet                        1247249       1247453	+0.02%
BenchmarkKeanuAndSpeed                      1275522       1275243	-0.02%
BenchmarkKeanuOther                         2021107       2021497	+0.02%
BenchmarkKeanuBullockOther                  2682243       2683250	+0.04%
2014-08-13 16:01:32 +09:30
b6d966e9b5 fix and iterator, add some logging, and reenable 2014-08-12 16:38:10 -04:00
kortschak
99d44e3228 Add test and make it pass 2014-08-12 10:20:26 +09:30
kortschak
2540ea8f87 Use cznic/b for index store
$ benchcmp gollrb.bench b-gen.bench
benchmark                                   old ns/op       new ns/op	delta
BenchmarkNamePredicate                      1731218         1693373		-2.19%
BenchmarkLargeSetsNoIntersection            81290360        70205277	-13.64%
BenchmarkVeryLargeSetsSmallIntersection     768135620       442906243	-42.34%
BenchmarkHelplessContainsChecker            39477086024     35260603748	-10.68%
BenchmarkNetAndSpeed                        22510637        21587975	-4.10%
BenchmarkKeanuAndNet                        18018886        17795328	-1.24%
BenchmarkKeanuAndSpeed                      20336586        20560228	+1.10%
BenchmarkKeanuOther                         85495040        80718152	-5.59%
BenchmarkKeanuBullockOther                  95457792        83868434	-12.14%

Code gen from $GOPATH/src/github.com/cznic/b:

  make generic \
| sed -e 's/KEY/int64/g' -e 's/VALUE/struct{}/g' \
> $GOPATH/src/github.com/google/cayley/graph/memstore/b/keys.go

key_test.go manually edited.
2014-08-11 20:45:55 +09:30
664b37b9a6 Merge branch 'master' into log_database 2014-08-10 21:50:36 -04:00
aad21b0585 Fix aborted materialization 2014-08-10 21:49:57 -04:00
48711af1d9 Mongo log works (and bug fixed) 2014-08-10 21:05:39 -04:00
3770190db5 test clean 2014-08-10 20:10:00 -04:00
6d22037602 add iterator check for mongo 2014-08-10 19:41:22 -04:00
ff148f58f8 first swing at mongo indexing (iterator todo) 2014-08-10 19:35:26 -04:00
8821c1968d add config options and graph.Handle 2014-08-10 18:17:38 -04:00
a1e5a53dd5 Merge with new Next() interface 2014-08-10 17:59:09 -04:00
kortschak
2d4c07b56d Make db name-literal agnostic
Move the persistence characteristic of the store into the graph registry
and provide an API hook to get that information.

Add error return for init on a non-persistent store.

Updates #35.
2014-08-08 08:36:49 +09:30
kortschak
191244c40e Sync iteration calls to Nexter interface changes 2014-08-07 07:07:45 +09:30
kortschak
62785d25c2 Merge branch 'master' into nexter
Conflicts:
	graph/leveldb/all_iterator.go
	graph/leveldb/iterator.go
	graph/memstore/triplestore.go
	query/gremlin/finals.go
2014-08-07 06:57:45 +09:30
b74cb142f0 Key/Keyer 2014-08-06 16:59:46 -04:00
6d4738cf0c convert to using real quads 2014-08-06 16:24:31 -04:00
c64acabee0 merge to master 2014-08-06 16:21:57 -04:00
2b43185117 rename Hashable/Hasher 2014-08-06 15:58:37 -04:00
4d9dd42dd8 comment 2014-08-06 15:51:56 -04:00
840c341274 Fix ID Lookup 2014-08-06 15:39:55 -04:00
6f1e46c2d8 Fix hashability for graph.Value 2014-08-06 15:34:30 -04:00
2bec255b52 Copy refs and comment on Value 2014-08-06 14:37:37 -04:00
76efc2fcb7 redo data structure for sensibility 2014-08-06 04:07:30 -04:00
d102394836 bounds errors 2014-08-06 03:49:55 -04:00
24f57df859 fix overshoot and optimize better 2014-08-06 03:49:55 -04:00
09244ddd38 materialize implementation and and optimization 2014-08-06 03:49:55 -04:00
c3bd1644a1 speedup and cleanup 2014-08-05 16:28:47 -04:00
d4e5eead32 convert leveldb to log-structure 2014-08-05 14:17:38 -04:00
kortschak
2c6f0f7345 Clean up residual changes
Remove done TODOs and unnecessary helpers.
2014-08-05 23:27:13 +09:30
kortschak
6acfdcc5d6 Use concrete value for quad.Quad
Comparison of -short benchmarks in cayley.

$ benchcmp pointer.bench concrete.bench
benchmark                                   old ns/op     new ns/op	delta
BenchmarkNamePredicate                      1673276       1655093	-1.09%
BenchmarkLargeSetsNoIntersection            318985907     261499984	-18.02%
BenchmarkNetAndSpeed                        104403743     41516981	-60.23%
BenchmarkKeanuAndNet                        17309258      16857513	-2.61%
BenchmarkKeanuAndSpeed                      20159161      19282833	-4.35%

Comparison of pathological cases are not so happy.

benchmark                                   old ns/op       new ns/op		delta
BenchmarkVeryLargeSetsSmallIntersection     55269775527     246084606672	+345.24%
BenchmarkHelplessContainsChecker            23436501319     24308906949		+3.72%

Profiling the worst case:

Pointer:
Total: 6121 samples
    1973  32.2%  32.2%     1973  32.2% runtime.findfunc
     773  12.6%  44.9%      773  12.6% readvarint
     510   8.3%  53.2%      511   8.3% step
     409   6.7%  59.9%      410   6.7% runtime.gentraceback
     390   6.4%  66.2%      391   6.4% pcvalue
     215   3.5%  69.8%      215   3.5% runtime.funcdata
     181   3.0%  72.7%      181   3.0% checkframecopy
     118   1.9%  74.6%      119   1.9% runtime.funcspdelta
      96   1.6%  76.2%       96   1.6% runtime.topofstack
      76   1.2%  77.5%       76   1.2% scanblock

Concrete:
Total: 25027 samples
    9437  37.7%  37.7%     9437  37.7% runtime.findfunc
    3853  15.4%  53.1%     3853  15.4% readvarint
    2366   9.5%  62.6%     2366   9.5% step
    2186   8.7%  71.3%     2186   8.7% runtime.gentraceback
    1816   7.3%  78.5%     1816   7.3% pcvalue
    1016   4.1%  82.6%     1016   4.1% runtime.funcdata
     859   3.4%  86.0%      859   3.4% checkframecopy
     506   2.0%  88.1%      506   2.0% runtime.funcspdelta
     410   1.6%  89.7%      410   1.6% runtime.topofstack
     303   1.2%  90.9%      303   1.2% runtime.newstack
2014-08-05 23:25:02 +09:30
dcb495d145 Make Memstore work with the QuadWriter 2014-08-04 01:56:49 -04:00
81b3bf9881 rename to quads 2014-08-04 00:45:32 -04:00