aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/testdata/testprogcgo/stackswitch.c
diff options
context:
space:
mode:
authorJonathan Amsterdam <jba@google.com>2023-09-11 10:59:48 -0400
committerJonathan Amsterdam <jba@google.com>2023-09-12 17:47:07 +0000
commit9f5a2cf61cc0c2389c577a00b5914235236d6c7f (patch)
tree95843e65d0c8df1596a48e162bb9ae9b59d80684 /src/runtime/testdata/testprogcgo/stackswitch.c
parent3602465954016ea1daef407764a7e4f23ab1c198 (diff)
downloadgo-9f5a2cf61cc0c2389c577a00b5914235236d6c7f.tar.xz
net/http: mapping data structure
Our goal for the new ServeMux patterns is to match the routing performance of the existing ServeMux patterns. To achieve that we needed to optimize lookup for small maps. This CL introduces a simple data structure called a mapping that optimizes lookup by using a slice for small collections of key-value pairs, switching to a map when the collection gets large. Mappings are a core part of the routing algorithm, which uses a decision tree to match path elements. The children of a tree node are held in a mapping. Change-Id: I923b3ad1376ace2c3e3421aa9b802ad12d47c871 Reviewed-on: https://go-review.googlesource.com/c/go/+/526617 Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Eli Bendersky <eliben@google.com> Reviewed-by: Damien Neil <dneil@google.com>
Diffstat (limited to 'src/runtime/testdata/testprogcgo/stackswitch.c')
0 files changed, 0 insertions, 0 deletions