1 var urls
= ['plus.google.com',
7 'lh3.googleusercontent.com',
8 'encrypted-tbn3.gstatic.com',
9 'encrypted-tbn2.gstatic.com',
10 'encrypted-tbn1.gstatic.com',
11 'encrypted-tbn2.gstatic.com',
12 'encrypted-tbn2.gstatic.com',
13 'encrypted-tbn2.gstatic.com',
14 'encrypted-tbn0.gstatic.com',
15 'encrypted-tbn0.gstatic.com',
16 'encrypted-tbn2.gstatic.com',
17 'encrypted-tbn0.gstatic.com',
18 'encrypted-tbn3.gstatic.com',
19 'encrypted-tbn3.gstatic.com',
20 'encrypted-tbn0.gstatic.com',
21 'encrypted-tbn1.gstatic.com',
22 'encrypted-tbn2.gstatic.com',
23 'encrypted-tbn1.gstatic.com',
24 'encrypted-tbn3.gstatic.com',
25 'encrypted-tbn0.gstatic.com',
26 'encrypted-tbn3.gstatic.com',
49 'img02.taobaocdn.com',
50 'img02.taobaocdn.com',
51 'img02.taobaocdn.com',
52 'img02.taobaocdn.com',
53 'img03.taobaocdn.com',
54 'img04.taobaocdn.com',
55 'img04.taobaocdn.com',
68 'suggestion.baidu.com',
69 'clients1.google.com',
70 'clients1.google.com',
71 'clients1.google.com',
72 'clients1.google.com',
73 'clients1.google.com',
74 'clients1.google.com',
79 'clients1.google.com',
80 'clients4.google.com',
83 'calendar.google.com',
84 'calendar.google.com',
85 'calendar.google.com',
86 'calendar.google.com',
87 'calendar.google.com',
88 'calendar.google.com',
98 'clients1.google.com',
102 'accounts.google.com',
103 'clients2.google.com',
104 '0.client-channel.google.com',
105 'safebrowsing.google.com',
106 'safebrowsing-cache.google.com',
107 'client24.dropbox.com',
139 '0.talkgadget.google.com',
141 '0.talkgadget.google.com',
142 '0.talkgadget.google.com',
144 '0.talkgadget.google.com',
154 'graph.facebook.com',
158 'notify1.dropbox.com',
202 'proxy.googlezip.net',
203 'clients4.google.com',
204 'clients6.google.com',
205 'talkgadget.google.com',
212 'lh3.googleusercontent.com',
216 'program-think.blogspot.com',
218 'program-think.blogspot.com',
220 'program-think.blogspot.com',
221 'www.google-analytics.com',
225 'html.atm.youku.com',
226 'html.atm.youku.com',
227 'html.atm.youku.com',
228 'html.atm.youku.com',
230 'html.atm.youku.com',
231 'html.atm.youku.com',
242 'html.atm.youku.com',
246 'static.atm.youku.com',
247 'static.atm.youku.com',
248 'static.atm.youku.com',
249 'static.atm.youku.com',
250 'static.atm.youku.com',
251 'static.atm.youku.com',
252 'static.atm.youku.com',
254 'lh6.googleusercontent.com',
255 'accounts.google.com',
256 'lh4.googleusercontent.com',
257 'oauth.googleusercontent.com',
267 'github-camo.global.ssl.fastly.net',
268 'clients1.google.com',
276 'suggestqueries.google.com',
277 'suggestqueries.google.com',
278 'suggestqueries.google.com',
279 'suggestqueries.google.com',
284 'clients4.google.com',
303 'accounts.google.com',
305 'notify1.dropbox.com',
306 'notify1.dropbox.com',
307 'calendar.google.com',
308 'calendar.google.com',
314 'clients4.google.com',
315 'init.itunes.apple.com',
316 'upp.itunes.apple.com',
317 'suggestqueries.google.com',
318 'suggestqueries.google.com',
319 'suggestqueries.google.com',
327 'notify1.dropbox.com',
328 'calendar.google.com',
330 'calendar.google.com',
332 'calendar.google.com',
341 'userstream.twitter.com',
346 'userstream.twitter.com',
347 'userstream.twitter.com',
348 'mobile.twitter.com',
349 'mobile.twitter.com',
350 'mobile.twitter.com',
351 'mobile.twitter.com',
352 'mobile.twitter.com',
353 'mobile.twitter.com',
359 'mobile.twitter.com',
362 'notify1.dropbox.com',
363 'calendar.google.com',
365 'calendar.google.com',
368 'accounts.google.com',
371 'calendar.google.com',
378 'userstream.twitter.com',
384 'userstream.twitter.com',
385 'userstream.twitter.com',
387 'init.itunes.apple.com',
388 'su.itunes.apple.com',
389 'p35-buy.itunes.apple.com',
445 'clients2.google.com',
446 'client45.dropbox.com',
466 'talkx.l.google.com',
467 'userstream.twitter.com',
481 'clients6.google.com',
490 '0.drive.google.com',
491 '0.talkgadget.google.com',
492 '0.talkgadget.google.com',
493 'talkgadget.google.com',
495 'accounts.google.com',
497 'chatenabled.mail.google.com',
499 'clients4.google.com',
504 'userstream.twitter.com',
505 'lh4.googleusercontent.com',
506 'lh6.googleusercontent.com',
507 'lh3.googleusercontent.com',
508 'lh4.googleusercontent.com',
509 'lh5.googleusercontent.com',
510 'lh4.googleusercontent.com',
531 'clients4.google.com',
540 'clients4.google.com',
541 'safebrowsing.google.com',
545 'clients4.google.com',
548 'userstream.twitter.com',
549 'notify1.dropbox.com',
556 'userstream.twitter.com',
558 'calendar.google.com',
560 'calendar.google.com',
562 'accounts.google.com',
563 'calendar.google.com',
577 'talkx.l.google.com',
585 'chart.apis.google.com',
586 'clients4.google.com',
587 'userstream.twitter.com',
588 'suggestqueries.google.com',
589 'suggestqueries.google.com',
591 'lh3.googleusercontent.com',
592 'lh3.googleusercontent.com',
593 'lh3.googleusercontent.com',
594 'talkgadget.google.com',
595 'talkgadget.google.com',
597 'oauth.googleusercontent.com',
598 'clients6.google.com',
599 'clients6.google.com',
600 'clients6.google.com',
601 'clients6.google.com',
602 'clients6.google.com',
603 'clients6.google.com',
604 'clients1.google.com',
605 'encrypted-tbn0.gstatic.com',
606 'encrypted-tbn2.gstatic.com',
608 'encrypted-tbn3.gstatic.com',
610 'lh4.googleusercontent.com',
611 'lh4.googleusercontent.com',
612 'lh4.googleusercontent.com',
613 'lh4.googleusercontent.com',
614 'lh5.googleusercontent.com',
617 'clients4.google.com',
618 'encrypted-tbn1.gstatic.com',
619 'lh4.googleusercontent.com',
620 'lh4.googleusercontent.com',
623 'clients1.google.com',
624 'encrypted-tbn0.gstatic.com',
625 'encrypted-tbn1.gstatic.com',
626 'encrypted-tbn2.gstatic.com',
627 'encrypted-tbn3.gstatic.com',
630 'beacon.sina.com.cn',
636 'ssl.google-analytics.com',
652 '9429127371.a.uxengine.net',
653 '9429127371.a.uxengine.net',
654 '9429127371.a.uxengine.net',
655 '9429127371.a.uxengine.net',
658 'suggestqueries.google.com',
659 'suggestqueries.google.com',
660 'suggestqueries.google.com',
661 'clients4.google.com',
663 'suggestqueries.google.com',
664 'suggestqueries.google.com',
666 'avatars3.githubusercontent.com',
668 'github-camo.global.ssl.fastly.net',
670 'collector.githubapp.com',
671 'suggestqueries.google.com',
672 'suggestqueries.google.com',
679 'www.google-analytics.com',
680 'clients2.google.com',
681 'lh3.googleusercontent.com',
683 'accounts.google.com',
685 'mail-attachment.googleusercontent.com',
686 'clients2.google.com',
690 'oauth.googleusercontent.com',
691 'accounts.google.com',
694 var shExpMatch = function (test
, exp
){
695 // Dummy function for testing switchysharp pac.
696 // Any shExpMatch implementation could not be faster than this,
697 // which results in overestimated switchysharp pac performance.
702 var time
= process
.hrtime();
704 for (var j
= 0; j
< repeat
; j
++) {
705 for (var i
in urls
) {
707 FindProxyForURL(url
, url
);
711 var diff
= process
.hrtime(time
);
712 //console.log('total: ' + (diff[0] * 1e3 + diff[1] * 1e-6).toFixed(2) + 'ms');
713 console
.log('avg: ' + ((diff
[0] * 1e3
+ diff
[1] * 1e-6) * 1e3
/ repeat
/ urls
.length
).toFixed(2) + 'us');