mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 12:49:08 +00:00
LibRegex: Use a match table for character classes
Generate a sorted, compressed series of ranges in a match table for character classes, and use a binary search to find the matches. This is about a 3-4x speedup for character class match performance. :^)
This commit is contained in:
committed by
Andreas Kling
parent
478b36c37b
commit
8f722302d9
@@ -7,12 +7,14 @@
|
||||
#pragma once
|
||||
|
||||
#include "Forward.h"
|
||||
#include <AK/Vector.h>
|
||||
|
||||
namespace regex {
|
||||
|
||||
class Optimizer {
|
||||
public:
|
||||
static void append_alternation(ByteCode& target, ByteCode&& left, ByteCode&& right);
|
||||
static void append_character_class(ByteCode& target, Vector<CompareTypeAndValuePair>&& pairs);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user