mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Fix performance test for regexp cache
This commit is contained in:
parent
508a9c1800
commit
62bfa4ed93
@ -11,6 +11,7 @@
|
||||
#include <Common/OptimizedRegularExpression.h>
|
||||
#include <Common/ProfileEvents.h>
|
||||
#include <Common/likePatternToRegexp.h>
|
||||
#include <Common/HashTable/Hash.h>
|
||||
#include <base/defines.h>
|
||||
#include <base/StringRef.h>
|
||||
#include <boost/container_hash/hash.hpp>
|
||||
@ -21,6 +22,7 @@
|
||||
# include <hs.h>
|
||||
#endif
|
||||
|
||||
|
||||
namespace ProfileEvents
|
||||
{
|
||||
extern const Event RegexpCreated;
|
||||
@ -86,7 +88,7 @@ public:
|
||||
private:
|
||||
constexpr static size_t CACHE_SIZE = 100; /// collision probability
|
||||
|
||||
std::hash<String> hasher;
|
||||
DefaultHash<String> hasher;
|
||||
struct Bucket
|
||||
{
|
||||
String pattern; /// key
|
||||
|
@ -24,8 +24,8 @@
|
||||
<value>'.*' || toString(number) || '.'</value>
|
||||
<!-- simple patterns, low distinctness (10 patterns) -->
|
||||
<value>'.*' || toString(number % 10) || '.'</value>
|
||||
<!-- complex patterns, all unique -->
|
||||
<value>'([a-zA-Z][a-zA-Z0-9]*)://([^ /]+)(/[^ ]*)?([^ @]+)@([^ @]+)([0-9][0-9]?)/([0-9][0-9]?)/([0-9][0-9]([0-9][0-9])?)(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9])' || toString(number)</value>
|
||||
<!-- complex patterns, all unique - this is very slow (from 2 to 15 seconds) -->
|
||||
<!-- <value>'([a-zA-Z][a-zA-Z0-9]*)://([^ /]+)(/[^ ]*)?([^ @]+)@([^ @]+)([0-9][0-9]?)/([0-9][0-9]?)/([0-9][0-9]([0-9][0-9])?)(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9])' || toString(number)</value> -->
|
||||
<!-- complex patterns, low distinctness -->
|
||||
<value>'([a-zA-Z][a-zA-Z0-9]*)://([^ /]+)(/[^ ]*)?([^ @]+)@([^ @]+)([0-9][0-9]?)/([0-9][0-9]?)/([0-9][0-9]([0-9][0-9])?)(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9])' || toString(number % 10)</value>
|
||||
<!-- Note: for this benchmark, we are only interested in compilation time, not correctness, evaluation time or the result.
|
||||
|
Loading…
Reference in New Issue
Block a user