Commit 2c814949 authored by Geoff Simmons's avatar Geoff Simmons

Revise the big-O claim about .match().

parent 72e8490b
......@@ -178,11 +178,12 @@ lines. For example::
Matches with the ``.match()`` and ``.hasprefix()`` methods scale well
as the number of strings in the set increases. The time needed for
``.match()`` is formally O(1); for ``.hasprefix()`` it is O(*p*),
where *p* is the length of the longest string in the set that forms a
prefix of the string to be matched. In both cases, the number of
execution steps is independent of the number of strings in the set,
and is predictable and fast for large sets of strings.
``.match()`` is formally O(*l*), where *l* is the length of the
subject string (the string to be matched). For ``.hasprefix()`` it is
O(*p*), where *p* is the length of the longest string in the set that
forms a prefix of the subject. In both cases, the number of execution
steps is independent of the number of strings in the set, and is
predictable and fast for large sets of strings.
When new strings are added to a set (with new ``.add()`` statements in
``vcl_init``), the VCL code that executes the various operations
......
......@@ -174,11 +174,12 @@ lines. For example::
Matches with the ``.match()`` and ``.hasprefix()`` methods scale well
as the number of strings in the set increases. The time needed for
``.match()`` is formally O(1); for ``.hasprefix()`` it is O(*p*),
where *p* is the length of the longest string in the set that forms a
prefix of the string to be matched. In both cases, the number of
execution steps is independent of the number of strings in the set,
and is predictable and fast for large sets of strings.
``.match()`` is formally O(*l*), where *l* is the length of the
subject string (the string to be matched). For ``.hasprefix()`` it is
O(*p*), where *p* is the length of the longest string in the set that
forms a prefix of the subject. In both cases, the number of execution
steps is independent of the number of strings in the set, and is
predictable and fast for large sets of strings.
When new strings are added to a set (with new ``.add()`` statements in
``vcl_init``), the VCL code that executes the various operations
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment