comparison tests/test-url.py @ 14076:924c82157d46

url: move URL parsing functions into util to improve startup time The introduction of the new URL parsing code has created a startup time regression. This is mainly due to the use of url.hasscheme() in the ui class. It ends up importing many libraries that the url module requires. This fix helps marginally, but if we can get rid of the urllib import in the URL parser all together, startup time will go back to normal. perfstartup time before the URL refactoring (8796fb6af67e): ! wall 0.050692 comb 0.000000 user 0.000000 sys 0.000000 (best of 100) current startup time (139fb11210bb): ! wall 0.070685 comb 0.000000 user 0.000000 sys 0.000000 (best of 100) after this change: ! wall 0.064667 comb 0.000000 user 0.000000 sys 0.000000 (best of 100)
author Brodie Rao <brodie@bitheap.org>
date Sat, 30 Apr 2011 09:43:20 -0700
parents b2798c1defff
children 5fa21960b2f4
comparison
equal deleted inserted replaced
14075:bc101902a68d 14076:924c82157d46
51 51
52 import doctest 52 import doctest
53 53
54 def test_url(): 54 def test_url():
55 """ 55 """
56 >>> from mercurial.url import url 56 >>> from mercurial.util import url
57 57
58 This tests for edge cases in url.URL's parsing algorithm. Most of 58 This tests for edge cases in url.URL's parsing algorithm. Most of
59 these aren't useful for documentation purposes, so they aren't 59 these aren't useful for documentation purposes, so they aren't
60 part of the class's doc tests. 60 part of the class's doc tests.
61 61