This repository was archived by the owner on Mar 3, 2026. It is now read-only.
forked from jooby-project/jooby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRouterWebBench.java
More file actions
91 lines (85 loc) · 2.4 KB
/
Copy pathRouterWebBench.java
File metadata and controls
91 lines (85 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package io.jooby.router;
import io.jooby.internal.RouterImpl;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Setup;
import java.io.IOException;
public class RouterWebBench extends BaseBenchmark {
private RouterImpl tr;
@Setup
public void setup() {
// tr = new RouterImpl();
// tr.add(("/"));
//
// tr.add(("/favicon.ico"));
//
// tr.add(("/pages/*"));
// tr.add(("/pages/*"));
//
// tr.add(("/article"));
// tr.add(("/article/"));
// tr.add(("/article/near"));
// tr.add(("/article/{id}"));
// tr.add(("/article/{id}"));
// tr.add(("/article/@{id}"));
// tr.add(("/article/{id}/{opts}"));
//
// tr.add(("/article/{iffd}/edit"));
// tr.add(("/article/{id}/related"));
// tr.add(("/article/slug/{month}/-/{day}/{year}"));
//
// tr.add(("/admin/user"));
// tr.add(("/admin/user/"));
// tr.add(("/admin/user/{id}"));
// tr.add(("/admin/apps/{id}"));
// tr.add(("/admin/**ff"));
// tr.add(("/admin/apps/{id}/**ff"));
// tr.add(("/admin/apps/{id}"));
//
// tr.add(("/hubs/{hubID}/view"));
// tr.add(("/hubs/{hubID}/view/*"));
// tr.add(("/hubs/{hubID}/view/**page"));
// tr.add(("/hubs/{hubID}/users"));
//
// tr.add(("/users/super/**f"));
// tr.add(("/users/**f"));
//
// tr.prepare();
}
@Benchmark
public void benchmark() throws IOException {
// tr.matches(("/"));
//
// tr.matches(("/favicon.ico"));
//
// tr.matches(("/pages/"));
// tr.matches(("/pages/yes"));
//
// tr.matches(("/article"));
// tr.matches(("/article/"));
// tr.matches(("/article/near"));
// tr.matches(("/article/neard"));
// tr.matches(("/article/123"));
// tr.matches(("/article/@peter"));
// tr.matches(("/article/123/456"));
//
// tr.matches(("/article/111/edit"));
// tr.matches(("/article/22/related"));
// tr.matches(("/article/slug/sept/-/4/2015"));
//
// tr.matches(("/admin/user"));
// tr.matches(("/admin/user/"));
// tr.matches(("/admin/user/1"));
// tr.matches(("/admin/apps/33"));
// tr.matches(("/admin/lots/of/:fun"));
// tr.matches(("/admin/apps/333/woot"));
// tr.matches(("/admin/apps/333"));
//
// tr.matches(("/hubs/123/view"));
// tr.matches(("/hubs/123/view/index.html"));
// tr.matches(("/hubs/123/view/index.html"));
// tr.matches(("/hubs/123/users"));
//
// tr.matches(("/users/super/123/okay/yes"));
// tr.matches(("/users/123/okay/yes"));
}
}