-
Notifications
You must be signed in to change notification settings - Fork 5
/
notes.txt
55 lines (42 loc) · 2 KB
/
notes.txt
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
git:(next) ✗ » java -server -Dfile.encoding=UTF-8 -cp ~/projects/mojolly/local/scala/lib/scala-library.jar:. rl.Benchmark
string to encode: I'm a very long $tring with twitter://casualjim in, it
url to parse: http://www.詹姆斯.org/path/to/somewhere/?id=45&dskafd=safla&sdkfa=sd#dksd$sdl
java encoded: I%27m+a+very+long+%24tring+with+twitter%3A%2F%2Fcasualjim+in%2C+it
java parsed: http://www.%E8%A9%B9%E5%A7%86%E6%96%AF.org/path/to/somewhere/?id=45&dskafd=safla&sdkfa=sd#dksd$sdl
rl encoded: I'm%20a%20very%20long%20$tring%20with%20twitter://casualjim%20in,%20it
rl parsed: http://www.xn--8ws00zhy3a.org//path/to/somewhere/?sdkfa=sd&dskafd=safla&id=45#dksd$sdl
Start url encoding bench
Start url decoding bench
Starting uri parsing bench
Started: Sat Aug 06 15:19:19 BST 2011
To encode 1000000 uri's
Java took: 2642 millis
RL took: 1919 millis
To decode 1000000 uri's
Java took: 1847 millis
RL took: 684 millis
To parse 100000 uri's
java took: 917 millis
rl took: 5288 millis
git:(next) ✗ » scala -J-server -Dfile.encoding=UTF-8 rl.Benchmark
string to encode: I'm a very long $tring with twitter://casualjim in, it
url to parse: http://www.詹姆斯.org/path/to/somewhere/?id=45&dskafd=safla&sdkfa=sd#dksd$sdl
java encoded: I%27m+a+very+long+%24tring+with+twitter%3A%2F%2Fcasualjim+in%2C+it
java parsed: http://www.%E8%A9%B9%E5%A7%86%E6%96%AF.org/path/to/somewhere/?id=45&dskafd=safla&sdkfa=sd#dksd$sdl
rl encoded: I'm%20a%20very%20long%20$tring%20with%20twitter://casualjim%20in,%20it
rl parsed: http://www.xn--8ws00zhy3a.org//path/to/somewhere/?sdkfa=sd&dskafd=safla&id=45#dksd$sdl
Start url encoding bench
Start url decoding bench
Starting uri parsing bench
Started: Sat Aug 06 15:19:45 BST 2011
To encode 1000000 uri's
Java took: 2849 millis
RL took: 2068 millis
To decode 1000000 uri's
Java took: 1869 millis
RL took: 753 millis
To parse 100000 uri's
java took: 1101 millis
rl took: 5392 millis
```
So in the decoding and encoding part we're either on par with or faster than then java.net.URLEncoder and java.net.URLDecoder