Mercurial > hgrepos > Python > libs > ConfigMix
comparison tests/_perf_config.py @ 533:e43db776f80a
Perf script: "once" -> "one"
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 20 Dec 2021 22:46:08 +0100 |
| parents | c2947ac74b0c |
| children | 9546d38cd3f8 |
comparison
equal
deleted
inserted
replaced
| 532:c2947ac74b0c | 533:e43db776f80a |
|---|---|
| 59 print("simple-string: %.4f" % timeit.timeit('cfg.getvarl_s(u"tree1", u"tree2", "key4")', setup=setup, number=num)) | 59 print("simple-string: %.4f" % timeit.timeit('cfg.getvarl_s(u"tree1", u"tree2", "key4")', setup=setup, number=num)) |
| 60 print("simple-string: %.4f" % timeit.timeit('cfg.getvar(u"tree1.tree2.key4")', setup=setup, number=num)) | 60 print("simple-string: %.4f" % timeit.timeit('cfg.getvar(u"tree1.tree2.key4")', setup=setup, number=num)) |
| 61 print("simple-string: %.4f" % timeit.timeit('cfg.getvar_s(u"tree1.tree2.key4")', setup=setup, number=num)) | 61 print("simple-string: %.4f" % timeit.timeit('cfg.getvar_s(u"tree1.tree2.key4")', setup=setup, number=num)) |
| 62 print("-"*50) | 62 print("-"*50) |
| 63 | 63 |
| 64 if all or "expand-string-once" in opts: | 64 if all or "expand-string-one" in opts: |
| 65 print("expand-string-once: %.4f" % timeit.timeit('cfg.getvarl(u"tree1", u"tree2", "key11")', setup=setup, number=num)) | 65 print("expand-string-one: %.4f" % timeit.timeit('cfg.getvarl(u"tree1", u"tree2", "key11")', setup=setup, number=num)) |
| 66 print("expand-string-once: %.4f" % timeit.timeit('cfg.getvarl_s(u"tree1", u"tree2", "key11")', setup=setup, number=num)) | 66 print("expand-string-one: %.4f" % timeit.timeit('cfg.getvarl_s(u"tree1", u"tree2", "key11")', setup=setup, number=num)) |
| 67 print("expand-string-once: %.4f" % timeit.timeit('cfg.getvar(u"tree1.tree2.key11")', setup=setup, number=num)) | 67 print("expand-string-one: %.4f" % timeit.timeit('cfg.getvar(u"tree1.tree2.key11")', setup=setup, number=num)) |
| 68 print("expand-string-once: %.4f" % timeit.timeit('cfg.getvar_s(u"tree1.tree2.key11")', setup=setup, number=num)) | 68 print("expand-string-one: %.4f" % timeit.timeit('cfg.getvar_s(u"tree1.tree2.key11")', setup=setup, number=num)) |
| 69 print("-"*50) | 69 print("-"*50) |
| 70 | 70 |
| 71 if all or "expand-string-once-noncached" in opts: | 71 if all or "expand-string-one-noncached" in opts: |
| 72 print("expand-string-once-noncached: %.4f" % timeit.timeit('cfg.getvarl(u"tree1", u"tree2", "key12")', setup=setup, number=num)) | 72 print("expand-string-one-noncached: %.4f" % timeit.timeit('cfg.getvarl(u"tree1", u"tree2", "key12")', setup=setup, number=num)) |
| 73 print("expand-string-once-noncached: %.4f" % timeit.timeit('cfg.getvarl_s(u"tree1", u"tree2", "key12")', setup=setup, number=num)) | 73 print("expand-string-one-noncached: %.4f" % timeit.timeit('cfg.getvarl_s(u"tree1", u"tree2", "key12")', setup=setup, number=num)) |
| 74 print("expand-string-once-noncached: %.4f" % timeit.timeit('cfg.getvar(u"tree1.tree2.key12")', setup=setup, number=num)) | 74 print("expand-string-one-noncached: %.4f" % timeit.timeit('cfg.getvar(u"tree1.tree2.key12")', setup=setup, number=num)) |
| 75 print("expand-string-once-noncached: %.4f" % timeit.timeit('cfg.getvar_s(u"tree1.tree2.key12")', setup=setup, number=num)) | 75 print("expand-string-one-noncached: %.4f" % timeit.timeit('cfg.getvar_s(u"tree1.tree2.key12")', setup=setup, number=num)) |
| 76 print("-"*50) | 76 print("-"*50) |
| 77 | 77 |
| 78 if all or "expand-string-many" in opts: | 78 if all or "expand-string-many" in opts: |
| 79 print("expand-string-many: %.4f" % timeit.timeit('cfg.getvarl(u"tree1", u"tree2", "key10")', setup=setup, number=num)) | 79 print("expand-string-many: %.4f" % timeit.timeit('cfg.getvarl(u"tree1", u"tree2", "key10")', setup=setup, number=num)) |
| 80 print("expand-string-many: %.4f" % timeit.timeit('cfg.getvarl_s(u"tree1", u"tree2", "key10")', setup=setup, number=num)) | 80 print("expand-string-many: %.4f" % timeit.timeit('cfg.getvarl_s(u"tree1", u"tree2", "key10")', setup=setup, number=num)) |
