public void Setup() { _strings = GetStrings(100); _segments = new PathSegment[100]; for (var i = 0; i < _strings.Length; i++) { _segments[i] = new PathSegment(0, _strings[i].Length); } var samples = new int[Count]; for (var i = 0; i < samples.Length; i++) { samples[i] = i * (_strings.Length / Count); } var entries = new List <(string text, int _)>(); for (var i = 0; i < samples.Length; i++) { entries.Add((_strings[samples[i]], i)); } _linearSearch = new LinearSearchJumpTable(0, -1, entries.ToArray()); _dictionary = new DictionaryJumpTable(0, -1, entries.ToArray()); _trie = new ILEmitTrieJumpTable(0, -1, entries.ToArray(), vectorize: false, _dictionary); _vectorTrie = new ILEmitTrieJumpTable(0, -1, entries.ToArray(), vectorize: true, _dictionary); }
public void Setup() { _strings = GetStrings(100); _segments = new PathSegment[100]; for (var i = 0; i < _strings.Length; i++) { _segments[i] = new PathSegment(0, _strings[i].Length); } var samples = new int[Count]; for (var i = 0; i < samples.Length; i++) { samples[i] = i * (_strings.Length / Count); } var entries = new List <(string text, int _)>(); for (var i = 0; i < samples.Length; i++) { entries.Add((_strings[samples[i]], i)); } _linearSearch = new LinearSearchJumpTable(0, -1, entries.ToArray()); _dictionary = new DictionaryJumpTable(0, -1, entries.ToArray()); Debug.Assert(AsciiKeyedJumpTable.TryCreate(0, -1, entries, out _ascii)); _dictionaryLookup = new DictionaryLookupJumpTable(0, -1, entries.ToArray()); _customHashTable = new CustomHashTableJumpTable(0, -1, entries.ToArray()); }
public DfaState( Candidate[] candidates, IEndpointSelectorPolicy[] policies, JumpTable pathTransitions, PolicyJumpTable policyTransitions) { Candidates = candidates; Policies = policies; PathTransitions = pathTransitions; PolicyTransitions = policyTransitions; }
public void Setup() { _table = new ZeroEntryJumpTable(0, -1); _strings = new string[] { "index/foo/2", "index/hello-world1/2", "index/hello-world/2", "index//2", "index/hillo-goodbye/2", }; _segments = new PathSegment[] { new PathSegment(6, 3), new PathSegment(6, 12), new PathSegment(6, 11), new PathSegment(6, 0), new PathSegment(6, 13), }; }
public void Setup() { _default = new SingleEntryJumpTable(0, -1, "hello-world", 1); _trie = new ILEmitTrieJumpTable(0, -1, new[] { ("hello-world", 1), }, vectorize: false, _default);
public DfaState(Candidate[] candidates, JumpTable pathTransitions, PolicyJumpTable policyTransitions) { Candidates = candidates; PathTransitions = pathTransitions; PolicyTransitions = policyTransitions; }
public void Setup() { _implementation = new SingleEntryJumpTable(0, -1, "hello-world", 1); _prototype = new SingleEntryAsciiVectorizedJumpTable(0, -2, "hello-world", 1); _trie = new ILEmitTrieJumpTable(0, -1, new[] { ("hello-world", 1), }, vectorize: false, _implementation);