Commit graph

71 commits

Author SHA1 Message Date
ben hockey
138fbbe7ce collapse 2 iterations into 1 in memstore 2015-05-28 15:11:35 -05:00
ben hockey
678c7c843a move cmp to where it's used 2015-05-27 16:50:54 -05:00
Andrew Dunham
189961cb8d Remove deprecated ResultTree API 2015-04-28 15:57:35 -07:00
102b3d7ef5 fix NewAnd taking quadstore in tests 2015-04-19 15:18:11 -04:00
Andrew Dunham
0355b89f54 Don't save non-errors in the memstore iterator
As per the following link, io.EOF is returned to signal "no more items".
Thus, we don't treat this as an error, and don't save it.

https://godoc.org/github.com/cznic/b#Enumerator
2015-04-15 11:46:26 -07:00
Andrew Dunham
1b6395ed0a Make Close() method on Iterators return an error 2015-04-14 20:17:31 -07:00
Andrew Dunham
9cdeb519d7 Fix Err fallout for graph/memstore iterators 2015-04-14 18:56:05 -07:00
Andrew Dunham
6aad2b1818 Add static type assertions
Assert that various iterators satisfy the graph.Nexter interface
2015-04-14 16:28:46 -07:00
=
d545fc4b44 renamed GetType() to Type(), fixed iterator tests 2015-02-21 23:55:36 +01:00
=
35ccfe7677 Added functionality so quadstore is generated per request (if needed) for the new appengine backend \n CR : nobody \n Tests run: unit tests 2015-02-21 23:46:11 +01:00
cf3e286d15 Rewrite keys into concrete types, remove key package 2015-02-21 16:19:51 -05:00
l.albertalli
472d86223e Changed the ApplyDeltas signature 2015-02-10 18:17:54 -08:00
l.albertalli
50c3e5f93c Shortended function signature and changed flag priority 2015-02-10 10:48:02 -08:00
l.albertalli
6134bc8bdd Moved configuration to Quadwriter and added to config file 2015-02-09 18:43:26 -08:00
l.albertalli
ce1cce5a01 Added command line options to ignore duplicate quad in add or missing quad in delete 2015-02-06 17:49:16 -08:00
kortschak
46f987ca51 Make graph.Delta zero state invalid for use
Previously, an incorrectly initialised Delta (omission of Action) would
result in an Add operation. Make that detectable and return an error.
2015-01-27 08:39:50 +10:30
panamafrancis
abda6cbbb0 Refactoring of Delta.IDs & horizon functionality with a PrimaryKey type, needed for implementing UUID based primary keys for backends such as the appengine datastore \n Tests: at top level and if available per backend, if not then just visual 2014-12-01 23:00:06 +01:00
kortschak
e2eea6c283 Convert Type fields to use graph.Type
Add text encoding methods to replace string storage.
2014-09-05 09:49:15 +09:30
kortschak
62013d3dfc Replace DebugString with Describe
This change makes tree description completely open to mechanical
analysis and ensures consistency between description formats for each of
the iterator types.

Renamed StatsContainer.(Kind -> Type) for consistency.
2014-09-05 09:32:09 +09:30
kortschak
bf6412b55d Run go vet
Bugs found.
2014-08-28 12:22:37 +09:30
kortschak
8118c8d3cc Quieten deadcode 2014-08-28 12:04:45 +09:30
kortschak
484bf145a8 Remove non-documentation lint
Because of extensive nature of changes, tested all three non-memstore
backends - passed.
2014-08-28 11:51:39 +09:30
kortschak
dccf38cba6 Simplify godoc 2014-08-27 21:40:56 +09:30
kortschak
443a091b72 Rename triple entities were relevant 2014-08-27 21:27:01 +09:30
kortschak
12859a69a5 Rename triple* -> quad* files 2014-08-27 19:20:35 +09:30
kortschak
ca90da43f4 Generate cznic/b code as described in Makefile 2014-08-24 11:45:00 +09:30
kortschak
59ce5e5a58 Add generate help for memstore/b generation 2014-08-24 11:44:35 +09:30
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
f967b36f84 comments and concretized deltas 2014-08-14 01:24:39 -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
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
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
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
c64acabee0 merge to master 2014-08-06 16:21:57 -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
kortschak
b1a70d99aa Simplify Nexter interface
This change allows a Nexter to be used in the same manner as a scanner
using a for graph.Next(it) {} construction.

It is important that graph.Next(it) and any associated it.Result() calls
operate on the same iterator.
2014-08-01 09:15:02 +09:30
kortschak
f8e28e066e Rename NextResult -> NextPath
See discussion in #92.
2014-08-01 07:27:16 +09:30
cb177aa390 Merge pull request #92 from kortschak/names
Rename Check-ish -> Contains-ish
2014-07-31 16:58:53 -04:00
kortschak
1606e98d9f Rename Check-ish -> Contains-ish
Contains[*] indicates what the check is for.

[*] I considered Has/Have, but settled on Contains to avoid confusion
with the HasA iterator.
2014-07-31 15:29:42 +09:30
kortschak
b17334ea36 Remove terminal newline from quad.Quad stringer
This is the conventional implementation of a fmt.Stringer.

Also went through and fixed up some lint.
2014-07-31 11:43:20 +09:30
kortschak
2dbbd17fe1 Merge branch 'declassify' into tip
Conflicts:
	graph/iterator/hasa_iterator.go
	graph/iterator/linksto_iterator.go
	graph/iterator/query_shape_test.go
	graph/leveldb/all_iterator.go
	graph/leveldb/iterator.go
	graph/leveldb/leveldb_test.go
	graph/memstore/triplestore_test.go
	graph/mongo/iterator.go
2014-07-30 16:40:37 +09:30
kortschak
d6f94be514 Base nexting on interface satisfaction
This is done unsubtlely at the moment and there is plenty of room for
optimisation of assertion location to prevent repeated reasserting as is
done now.
2014-07-30 16:06:46 +09:30
kortschak
b498a06a7b Intermediate step in removal of Base
We are marking types that will be Nexters and ResultNexters (I want a
better name for this one).
2014-07-30 15:21:48 +09:30
kortschak
375d953d93 Move current result handling out of Base
Delete majority of Base functionality.
2014-07-30 15:03:06 +09:30
kortschak
525230206a Move SubIterator handling out of Base 2014-07-30 12:11:14 +09:30
kortschak
01b7278c3a Move UID handling from Base
Also clean up some of the value creation code.
2014-07-30 11:44:58 +09:30
kortschak
1604dca737 Move tag handling out into graph.Tagger 2014-07-30 10:25:32 +09:30