File: performance_nethtml.ml

package info (click to toggle)
ocaml-markup 1.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,340 kB
  • sloc: ml: 15,131; makefile: 89
file content (21 lines) | stat: -rw-r--r-- 485 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(* This file is part of Markup.ml, released under the MIT license. See
   LICENSE.md for details, or visit https://github.com/aantron/markup.ml. *)

open Performance_common
open Nethtml

let (|>) x f = f x

let parse file =
  file
  |> open_in
  |> Lexing.from_channel
  |> parse_document ~dtd:relaxed_html40_dtd
  |> ignore

let () =
  measure 100 "nethtml" google_page "html" (fun () ->
    parse google_page);

  measure 100 "nethtml" xml_spec "html" (fun () ->
    parse xml_spec)