+
+
+// ----------------------------------------------------------------------------
+// wxString::operator[] - parse large HTML page
+// ----------------------------------------------------------------------------
+
+class DummyParser : public wx28HtmlParser
+{
+public:
+ virtual wxObject* GetProduct() { return NULL; }
+ virtual void AddText(const wxChar*) {}
+};
+
+
+BENCHMARK_FUNC(ParseHTML)
+{
+ // static so that construction time is not counted
+ static DummyParser parser;
+ static wxString html;
+ if ( html.empty() )
+ {
+ wxString html1;
+ wxFFile("htmltest.html").ReadAll(&html1, wxConvUTF8);
+
+ // this is going to make for some invalid HTML, of course, but it
+ // doesn't really matter
+ long num = Bench::GetNumericParameter();
+ if ( !num )
+ num = 1;
+
+ for ( long n = 0; n < num; n++ )
+ html += html1;
+ }
+
+ parser.Parse(html);
+
+ return true;
+}