diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2013-06-03 10:33:03 -0400 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2013-06-03 10:33:03 -0400 |
commit | b2ae0fc1c5b7d54f67568123ee0346f7f9c6c487 (patch) | |
tree | e825d9297b05ecde290bd52b5d4bbffa3298668c /bs4/diagnose.py | |
parent | 35d51110391923e0b66ad5d9e0da44e510273a42 (diff) | |
download | beautifulsoup4-b2ae0fc1c5b7d54f67568123ee0346f7f9c6c487.tar.gz |
Improved performance for html5lib.
Diffstat (limited to 'bs4/diagnose.py')
-rw-r--r-- | bs4/diagnose.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bs4/diagnose.py b/bs4/diagnose.py index ad79d8a..bd995c2 100644 --- a/bs4/diagnose.py +++ b/bs4/diagnose.py @@ -196,12 +196,12 @@ def profile(num_elements=100000, parser="lxml"): cProfile.runctx('bs4.BeautifulSoup(data, parser)' , vars, vars, filename) stats = pstats.Stats(filename) - stats.strip_dirs() + # stats.strip_dirs() cumulative = stats.sort_stats("cumulative") total = stats.sort_stats("time") - total.print_stats(50) + cumulative.print_stats('_html5lib|bs4', 50) if __name__ == '__main__': #diagnose(sys.stdin.read()) - profile(1000, parser="html5lib") + profile(10000, parser="html5lib") # benchmark_parsers() |