package
23.1.1+incompatible
Repository: https://github.com/dgraph-io/dgraph.git
Documentation: pkg.go.dev
# README
Comparing the old and new methods, we find that using slice makes the parsing 20% faster on average than using channels. Also, using slices allows the parser to backtrack and peek the tokens which couldn't be done using channels as each token can only be consumed once.
Name unit Old New Improvement
----------------------------------------------------------------------
Benchmark_Filters-4 ns/op 14007 9634 31 %
Benchmark_Geq-4 ns/op 11701 8602 26 %
Benchmark_Date-4 ns/op 11687 8630 26 %
Benchmark_directors-4 ns/op 18663 14201 23 %
Benchmark_Filters_parallel-4 ns/op 6486 5015 22 %
Benchmark_Movies-4 ns/op 16097 12807 20 %
Benchmark_directors_parallel-4 ns/op 8766 6966 20 %
Benchmark_Mutation-4 ns/op 5167 4155 19 %
Benchmark_Movies_parallel-4 ns/op 7537 6151 18 %
Benchmark_Date_parallel-4 ns/op 5462 4515 17 %
Benchmark_Geq_parallel-4 ns/op 5390 4485 16 %
Benchmark_Mutation_parallel-4 ns/op 2326 2161 07 %
Benchmark_Mutation1000-4 ns/op 549428 512851 06 %
Benchmark_Mutation1000_parallel-4 ns/op 261785 254911 02 %
# Functions
Parse initializes and runs the lexer.
ParseMutation parses a block into a mutation.
ParseUid parses the given string into an UID.
ParseWithNeedVars performs parsing of a query with given needVars.
# Structs
Arg stores an argument to a function.
FacetOrder stores ordering for single facet key.
FilterTree is the result of parsing the filter directive.
Function holds the information about dql functions.
GraphQuery stores the parsed Query in a tree format.
GroupByAttr stores the arguments needed to process the @groupby directive.
MathTree represents math operations in tree form for evaluation.
Mutation stores the strings corresponding to set and delete operations.
NQuad is an alias for the NQuad type in the API protobuf library.
RecurseArgs stores the arguments needed to process the @recurse directive.
Request stores the query text and the variable mapping.
Result struct contains the Query list, its corresponding variable use list and the mutation block.
ShortestPathArgs stores the arguments needed to process the shortest path query.
VarContext stores information about the vars needed to complete a query.
Vars struct contains the list of variables defined and used by a query block.