- 31 May, 2020 2 commits
-
-
Geoff Simmons authored
The VMOD does this during .compile(), and QP_Insert() is no longer called during .add(). The .compile() call is now required in all cases, and it must be called before .create_stats(). This is because QP_Insert() was not correctly rotating the trie when a set has overlapping prefixes, and a shorter prefix was added before the longer one. With sorted order, shorter prefixes are always added first, so rotation is unnecessary.
-
Geoff Simmons authored
This reverts commit afded0f5.
-
- 27 Mar, 2020 2 commits
-
-
Geoff Simmons authored
-
Geoff Simmons authored
The new algorithm improves efficiency with iteration in place of recursion, and in a number of other ways: - Avoid searches into dead-end branches. The traversal of all branches was done because of the overlapping prefix case -- "foo" and "foobar" both in the set. Now we just search the tree for a match, but before descending into the next branch, check if there are other branches at which the current prefix matches a terminating node. - Only do string comparisons when we hit a terminating node. - Mark terminating nodes with a flag in the tree, so that we don't go looking for the null byte in the strings table during the search. While we're here, rename the flag for the nibble search as hinib -- non-zero if and only if we inspect the most significant nibble at that node. Also remove some dead code from QP_Insert().
-
- 26 Mar, 2020 3 commits
-
-
Geoff Simmons authored
-
Geoff Simmons authored
-
Geoff Simmons authored
-
- 24 Mar, 2020 2 commits
-
-
Geoff Simmons authored
May be advantageous for loop/branch prediction.
-
Geoff Simmons authored
Theoretically, this reduces the probability of collisions. Benchmarks don't show much of a difference.
-
- 20 Mar, 2020 3 commits
-
-
Geoff Simmons authored
This adds the .compile() method to set objects, required for the use of .match(). Docs for the .compile() method are currently incomplete.
-
Geoff Simmons authored
strlen() is also cheap if it has a SIMD implementation, so we can afford this optimization to reject some strings immediately.
-
Geoff Simmons authored
-
- 06 Mar, 2020 3 commits
-
-
Geoff Simmons authored
-
Geoff Simmons authored
-
Geoff Simmons authored
Cannot be used for prefix matches.
-
- 03 Mar, 2020 7 commits
-
-
Geoff Simmons authored
-
Geoff Simmons authored
-
Geoff Simmons authored
For "quadbit patricia tries", inspired by the work of Tony Finch: https://dotat.at/prog/qp/README.html Radix 16 tries, examining a nibble at a time, to make the tries smaller and reduce pointer chasing.
-
Geoff Simmons authored
-
Geoff Simmons authored
-
Geoff Simmons authored
-
Geoff Simmons authored
Only call strcmp() once, when a node is reached that must be either a hit or a miss.
-
- 28 Feb, 2020 1 commit
-
-
Geoff Simmons authored
-
- 27 Feb, 2020 1 commit
-
-
Geoff Simmons authored
The search may have matched a string that is actually a prefix of the subject string, if a longer string with the same prefix is also in the set. This "happens" to give correct results for match(), but which() would return the wrong value. The fix uses strcmp() instead of memcmp(), but that is also vectorized, where the C library uses vector instructions.
-
- 26 Feb, 2020 4 commits
-
-
Geoff Simmons authored
-
Geoff Simmons authored
-
Geoff Simmons authored
-
Geoff Simmons authored
Vector extensions are common hardware now, as are C libraries that use vector instructions to implement functions like memcmp(). So we hand off compares to the lib to get the advantage. For the same reason, we can afford to call strlen() on the subject string to locate the terminating null, rather than scan for it. Also, the match function descends through the trie to find a potential match, and does the comparison only then, as is common for trie/critbit/patricia implementations.
-
- 10 Dec, 2019 1 commit
-
-
Nils Goroll authored
since varnish-cache ecef48518f3b3f4bbf28256e090bdbb5cd2b163c backends can be NULL (as defined with backend <name> None)
-
- 09 Dec, 2019 1 commit
-
-
Geoff Simmons authored
Fixes #1
-
- 31 Oct, 2019 1 commit
-
-
Geoff Simmons authored
configure checks if you have lcov & genhtml; these can be specified with --with-lcov and/or --with-genhtml. If they are available, then make coverage does the following: - make clean, then make check with CC=gcc and CFLAGS set so that inputs for gcov/lcov are generated. - lcov creates the src/coverage subdir and generates a targetfile there. - genhtml generates HTML reports in src/coverage.
-
- 02 Oct, 2019 2 commits
-
-
Geoff Simmons authored
-
Geoff Simmons authored
-
- 22 Aug, 2019 1 commit
-
-
Geoff Simmons authored
-
- 21 Aug, 2019 2 commits
-
-
Geoff Simmons authored
-
Geoff Simmons authored
-
- 07 Apr, 2019 1 commit
-
-
Nils Goroll authored
See also https://github.com/varnishcache/varnish-cache/issues/2967 for a general discussion regarding an inconsistency in the WS_Reserve() interface
-
- 26 Mar, 2019 1 commit
-
-
Nils Goroll authored
-
- 07 Mar, 2019 2 commits
-
-
Geoff Simmons authored
-
Geoff Simmons authored
-