1 Initial performance under ANTLR:
3 short slab of ASCII text 14.380000 2.240000 16.620000 ( 16.685454)
4 short slab of UTF-8 text 18.080000 2.420000 20.500000 ( 21.965856)
6 After move to Ragel scanner:
8 short slab of ASCII text 5.010000 0.010000 5.020000 ( 5.033520)
9 short slab of UTF-8 text 9.130000 0.010000 9.140000 ( 9.158980)
11 About 28% of time is being spent inside rb_ary_includes
12 (compared with only 14% in the next_token function)
14 After adding custom C replacement for Ruby Array class:
16 short slab of ASCII text 3.400000 0.000000 3.400000 ( 3.417410)
17 short slab of UTF-8 text 6.290000 0.010000 6.300000 ( 6.314861)
19 Biggest drain is st_init_strtable (42%), something to do with strings
20 followed by 14% for rb_str_append
21 (next_token function now up to 22%)
23 After speeding up Ragel scanner with -G2 switch:
25 short slab of ASCII text 2.870000 0.000000 2.870000 ( 2.929794)
26 short slab of UTF-8 text 5.390000 0.010000 5.400000 ( 5.399399)
28 After replacing many rb_str_append calls with rb_str_cat
29 (for constant strings):
31 short slab of ASCII text 2.380000 0.010000 2.390000 ( 2.461861)
32 short slab of UTF-8 text 4.860000 0.000000 4.860000 ( 5.016289)
34 More rb_str_append calls replaced with rb_str_cat (token text):
36 short slab of ASCII text 1.570000 0.010000 1.580000 ( 1.705596)
37 short slab of UTF-8 text 3.280000 0.020000 3.300000 ( 3.353919)
39 After implementing profiling_parse method
40 (to minimize noise in profile from "times" method):
42 short slab of ASCII text 1.490000 0.000000 1.490000 ( 1.498188)
43 short slab of UTF-8 text 3.150000 0.010000 3.160000 ( 3.266873)
45 Biggest drain still st_init_strtable (34.1%),
46 followed by rb_str_append (12.3%),
47 and rb_str_buf_cat (11.2%)
48 not clear whether a custom string implementation would help here
49 (next_token function currently accounts for 13.3%)
51 New baseline after adding additional features (additional em and strong
52 tokens, email address tokenization and autolinking, whitespace trimming
53 for link components, optional options hash for parse method, automatic
54 indentation, and indentation overrides):
56 short slab of ASCII text 1.620000 0.010000 1.630000 ( 1.765099)
57 short slab of UTF-8 text 3.370000 0.010000 3.380000 ( 3.561710)
59 New baseline after adding more features and other changes (alternate
60 pre/blockquote syntax, img tags, more Garbage Collection) but also
61 improving performance due to removal of inappropriately inlined code:
63 short slab of ASCII text 1.980000 0.030000 2.010000 ( 2.116161)
64 short slab of UTF-8 text 4.040000 0.050000 4.090000 ( 4.471805)
65 longer slab of ASCII text 16.920000 0.150000 17.070000 ( 18.609802)
66 longer slab of UTF-8 text 50.460000 0.350000 50.810000 ( 53.719019)
70 short slab of ASCII text 2.010000 0.020000 2.030000 ( 2.133733)
71 short slab of UTF-8 text 3.990000 0.040000 4.030000 ( 4.174043)
72 longer slab of ASCII text 16.700000 0.120000 16.820000 ( 17.302634)
73 longer slab of UTF-8 text 50.010000 0.400000 50.410000 ( 54.708712)
75 "str" branch improvements (commit 65abcb4):
77 short slab of ASCII text 1.550000 0.010000 1.560000 ( 1.572018)
78 short slab of UTF-8 text 2.310000 0.020000 2.330000 ( 2.352641)
79 longer slab of ASCII text 13.780000 0.100000 13.880000 ( 14.034015)
80 longer slab of UTF-8 text 23.150000 0.130000 23.280000 ( 23.505007)
84 short slab of ASCII text 1.380000 0.010000 1.390000 ( 1.390273)
85 short slab of UTF-8 text 2.150000 0.010000 2.160000 ( 2.196478)
86 longer slab of ASCII text 13.210000 0.080000 13.290000 ( 13.547195)
87 longer slab of UTF-8 text 23.510000 0.170000 23.680000 ( 23.882669)
90 14.9% Wikitext_parser_parse
96 4.0% wiki_start_para_if_necessary
98 After switching to IN_EITHER_OF and IN_ANY_OF macros:
100 short slab of ASCII text 1.330000 0.010000 1.340000 ( 1.353676)
101 short slab of UTF-8 text 2.120000 0.010000 2.130000 ( 2.158128)
102 longer slab of ASCII text 12.350000 0.070000 12.420000 ( 12.508288)
103 longer slab of UTF-8 text 22.810000 0.150000 22.960000 ( 23.160102)
106 13.5% Wikitext_parser_parse
111 4.4% wiki_pop_excess_elements
113 4.1% wiki_start_para_if_necessary