Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-selector
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-selector
Commits
fc5f43da
Commit
fc5f43da
authored
Jul 08, 2018
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Doc polish.
parent
3aa68a30
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
README.rst
README.rst
+7
-1
vmod_selector.vcc
src/vmod_selector.vcc
+7
-1
No files found.
README.rst
View file @
fc5f43da
...
...
@@ -80,7 +80,7 @@ Operations such as these are commonly implemented in native VCL with
an ``if-elsif-elsif`` sequence of string comparisons or regex matches.
As the number of matches increases, such a sequence becomes cumbersome
and scales poorly -- the time needed to execute the sequence increases
with number of matches to be performed.
with
the
number of matches to be performed.
With the VMOD, the strings to be matched are declared in a tabular
form in ``vcl_init``, and the operation is executed in a few
...
...
@@ -174,6 +174,12 @@ matched. In both cases, the time for execution is independent of the
number of strings in the set, and is predictable and fast for large
sets of strings.
In the case of non-matches, the search for a match stops as soon as it
encounters a character in the string such that no string in the set
can match. Thus if a set contains the strings ``foo``, ``bar`` and
``baz``, then the search stops after the first character if it is
neither of ``f`` or ``b``.
When new strings are added to a set (with new ``.add()`` statements in
``vcl_init``), the VCL code that executes the various operations
(rewrites, backend assignment and so forth) can remain unchanged. So
...
...
src/vmod_selector.vcc
View file @
fc5f43da
...
...
@@ -69,7 +69,7 @@ Operations such as these are commonly implemented in native VCL with
an ``if-elsif-elsif`` sequence of string comparisons or regex matches.
As the number of matches increases, such a sequence becomes cumbersome
and scales poorly -- the time needed to execute the sequence increases
with number of matches to be performed.
with
the
number of matches to be performed.
With the VMOD, the strings to be matched are declared in a tabular
form in ``vcl_init``, and the operation is executed in a few
...
...
@@ -163,6 +163,12 @@ matched. In both cases, the time for execution is independent of the
number of strings in the set, and is predictable and fast for large
sets of strings.
In the case of non-matches, the search for a match stops as soon as it
encounters a character in the string such that no string in the set
can match. Thus if a set contains the strings ``foo``, ``bar`` and
``baz``, then the search stops after the first character if it is
neither of ``f`` or ``b``.
When new strings are added to a set (with new ``.add()`` statements in
``vcl_init``), the VCL code that executes the various operations
(rewrites, backend assignment and so forth) can remain unchanged. So
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment