Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Struct of Arrays approach #443

Merged
merged 7 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Benchmarks/Benchmarks/Router/Benchmarks.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ let benchmarks = {
],
warmupIterations: 10
)
binaryTrieRouterBenchmarks()
trieRouterBenchmarks()
routerBenchmarks()
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
import Benchmark
@_spi(Internal) import Hummingbird

func binaryTrieRouterBenchmarks() {
var trie: BinaryTrie<String>!
Benchmark("BinaryTrieRouter", configuration: .init(scalingFactor: .kilo)) { benchmark in
func trieRouterBenchmarks() {
var trie: RouterTrie<String>!
Benchmark("TrieRouter:Routing", configuration: .init(scalingFactor: .kilo)) { benchmark in
let testValues = [
"/test/",
"/test/one",
Expand All @@ -39,11 +39,11 @@ func binaryTrieRouterBenchmarks() {
trieBuilder.addEntry("/test/:value/:value2", value: "/test/:value:/:value2")
trieBuilder.addEntry("/api/v1/users/:id/profile", value: "/api/v1/users/:id/profile")
trieBuilder.addEntry("/test2/*/*", value: "/test2/*/*")
trie = BinaryTrie(base: trieBuilder)
trie = RouterTrie(base: trieBuilder)
}

var trie2: BinaryTrie<String>!
Benchmark("BinaryTrieRouterParameters", configuration: .init(scalingFactor: .kilo)) { benchmark in
var trie2: RouterTrie<String>!
Benchmark("TrieRouter:Parameters", configuration: .init(scalingFactor: .kilo)) { benchmark in
let testValues = [
"/test/value",
"/test/value1/value2",
Expand All @@ -61,11 +61,11 @@ func binaryTrieRouterBenchmarks() {
trieBuilder.addEntry("/test/:value/:value2", value: "/test/:value:/:value2")
trieBuilder.addEntry("/test2/*/*", value: "/test2/*/*")
trieBuilder.addEntry("/api/v1/users/:id/profile", value: "/api/v1/users/:id/profile")
trie2 = BinaryTrie(base: trieBuilder)
trie2 = RouterTrie(base: trieBuilder)
}

var trie3: BinaryTrie<String>!
Benchmark("BinaryTrie:LongPaths", configuration: .init(scalingFactor: .kilo)) { benchmark in
var trie3: RouterTrie<String>!
Benchmark("TrieRouter:LongPaths", configuration: .init(scalingFactor: .kilo)) { benchmark in
let testValues = [
"/api/v1/users/1/profile",
"/api/v1/a/very/long/path/with/lots/of/segments",
Expand All @@ -79,6 +79,6 @@ func binaryTrieRouterBenchmarks() {
let trieBuilder = RouterPathTrieBuilder<String>()
trieBuilder.addEntry("/api/v1/a/very/long/path/with/lots/of/segments", value: "/api/v1/a/very/long/path/with/lots/of/segments")
trieBuilder.addEntry("/api/v1/users/:id/profile", value: "/api/v1/users/:id/profile")
trie3 = BinaryTrie(base: trieBuilder)
trie3 = RouterTrie(base: trieBuilder)
}
}
163 changes: 0 additions & 163 deletions Sources/Hummingbird/Router/BinaryTrie/BinaryTrie+resolve.swift

This file was deleted.

48 changes: 0 additions & 48 deletions Sources/Hummingbird/Router/BinaryTrie/BinaryTrie.swift

This file was deleted.

Loading
Loading