git.iko.soy/typeable/html-parse
on master help sign in
Add some typical performance numbers
c2d36f0Ben Gamari
README.mkd+26
@@ -12,3 +12,29 @@ For instance,
12>>> parseTokens "<div><h1>Hello World</h1><br/><p class=widget>Example!</p></div>"
12>>> parseTokens "<div><h1>Hello World</h1><br/><p class=widget>Example!</p></div>"
13[TagOpen "div" [],TagOpen "h1" [],ContentText "Hello World",TagClose "h1",TagSelfClose "br" [],TagOpen "p" [Attr "class" "widget"],ContentText "Example!",TagClose "p",TagClose "div"]
13[TagOpen "div" [],TagOpen "h1" [],ContentText "Hello World",TagClose "h1",TagSelfClose "br" [],TagOpen "p" [Attr "class" "widget"],ContentText "Example!",TagClose "p",TagClose "div"]
14```
14```
15+
16+## Performance
17+
18+Here are some typical performance numbers taken from parsing a fairly
19+long [Wikipedia article](https://en.wikipedia.org/wiki/New_York_City),
20+```
21+benchmarking Forced/tagsoup fast Text
22+time 171.2 ms (166.4 ms .. 177.3 ms)
23+ 0.999 R² (0.997 R² .. 1.000 R²)
24+mean 171.9 ms (169.4 ms .. 173.2 ms)
25+std dev 2.516 ms (1.104 ms .. 3.558 ms)
26+variance introduced by outliers: 12% (moderately inflated)
27+
28+benchmarking Forced/tagsoup normal Text
29+time 176.9 ms (167.3 ms .. 188.5 ms)
30+ 0.998 R² (0.994 R² .. 1.000 R²)
31+mean 180.7 ms (177.5 ms .. 183.7 ms)
32+std dev 4.246 ms (2.316 ms .. 5.803 ms)
33+variance introduced by outliers: 14% (moderately inflated)
34+
35+benchmarking Forced/html-parser
36+time 20.88 ms (20.60 ms .. 21.25 ms)
37+ 0.999 R² (0.998 R² .. 0.999 R²)
38+mean 20.99 ms (20.81 ms .. 21.20 ms)
39+std dev 446.1 μs (336.4 μs .. 596.2 μs)
40+```
html-parse.cabal+32−5
@@ -6,15 +6,42 @@ description:
6 upon the @attoparsec@ library. The parsing strategy is based upon the HTML5
6 upon the @attoparsec@ library. The parsing strategy is based upon the HTML5
7 parsing specification with few deviations.
7 parsing specification with few deviations.
8 .
8 .
9+ For instance,
10+ .
11+ >>> parseTokens "<div><h1 class=widget>Hello World</h1><br/>"
12+ [TagOpen "div" [],
13+ TagOpen "h1" [Attr "class" "widget"],
14+ ContentText "Hello World",
15+ TagClose "h1",
16+ TagSelfClose "br" []]
17+ .
9 The package targets similar use-cases to the venerable @tagsoup@ library,
18 The package targets similar use-cases to the venerable @tagsoup@ library,
10 but is significantly more efficient, achieving parsing speeds of over 50
19 but is significantly more efficient, achieving parsing speeds of over 50
11− megabytes per second on modern hardware with and typical web documents.
20+ megabytes per second on modern hardware and typical web documents.
21+ Here are some typical performance numbers taken from parsing a Wikipedia
22+ article of moderate length:
12 .
23 .
13− For instance,
24+ @
25+ benchmarking Forced/tagsoup fast Text
26+ time 171.2 ms (166.4 ms .. 177.3 ms)
27+ 0.999 R² (0.997 R² .. 1.000 R²)
28+ mean 171.9 ms (169.4 ms .. 173.2 ms)
29+ std dev 2.516 ms (1.104 ms .. 3.558 ms)
30+ variance introduced by outliers: 12% (moderately inflated)
14 .
31 .
15− >>> parseTokens "<div><h1 class=widget>Hello World</h1><br/>"
32+ benchmarking Forced/tagsoup normal Text
16− [TagOpen "div" [],TagOpen "h1" [Attr "class" "widget"],
33+ time 176.9 ms (167.3 ms .. 188.5 ms)
17− ContentText "Hello World",TagClose "h1",TagSelfClose "br" []]
34+ 0.998 R² (0.994 R² .. 1.000 R²)
35+ mean 180.7 ms (177.5 ms .. 183.7 ms)
36+ std dev 4.246 ms (2.316 ms .. 5.803 ms)
37+ variance introduced by outliers: 14% (moderately inflated)
38+ .
39+ benchmarking Forced/html-parser
40+ time 20.88 ms (20.60 ms .. 21.25 ms)
41+ 0.999 R² (0.998 R² .. 0.999 R²)
42+ mean 20.99 ms (20.81 ms .. 21.20 ms)
43+ std dev 446.1 μs (336.4 μs .. 596.2 μs)
44+ @
18
45
19homepage: http://github.com/bgamari/html-parse
46homepage: http://github.com/bgamari/html-parse
20license: BSD3
47license: BSD3