forked from pillarjs/routington
-
Notifications
You must be signed in to change notification settings - Fork 0
/
benchmark.js
32 lines (26 loc) · 822 Bytes
/
benchmark.js
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
var router = require('./')()
router.define('/')
router.define('/:nav(about)')
router.define('/:identity(page)/:id([0-9a-f]{24}|\\w{3,30})')
router.define('/:identity(page)/:id([0-9a-f]{24}|\\w{3,30})/:nav(posts)/:tab(new)')
suite('routington', function () {
set('mintime', 1000)
bench('/', function () {
router.match('/')
router.match('/about')
})
bench('/about', function () {
router.match('/')
router.match('/about')
})
bench('/page/taylorswift', function () {
router.match('/page/taylorswift')
router.match('/page/taylorswift/posts')
router.match('/page/taylorswift/posts/new')
})
bench('/page/taylorswift/posts/new', function () {
router.match('/page/taylorswift')
router.match('/page/taylorswift/posts')
router.match('/page/taylorswift/posts/new')
})
})