Skip to content

Commit

Permalink
perf: add v1.0.1 probe
Browse files Browse the repository at this point in the history
  • Loading branch information
storenth committed Jan 28, 2024
1 parent a2dff51 commit e5a9a61
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 23 deletions.
24 changes: 1 addition & 23 deletions PERFORMANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,4 @@ def run():
pass

@timefn: run took 0.0010941028594970703 seconds
```
3. Cartesian product
```
python3 -m cProfile -s calls ./src/pnk/__main__.py -c < src/tests/one.txt
@timefn: run took 0.0016446113586425781 seconds
17880 function calls (17305 primitive calls) in 0.017 seconds
ncalls tottime percall cumtime percall filename:lineno(function)
1437 0.000 0.000 0.000 0.000 {method 'append' of 'list' objects}
1180/1059 0.000 0.000 0.000 0.000 {built-in method builtins.len}
1099 0.000 0.000 0.000 0.000 {method 'rstrip' of 'str' objects}
1069 0.000 0.000 0.000 0.000 {built-in method builtins.isinstance}
888 0.000 0.000 0.000 0.000 {method 'join' of 'str' objects}
708 0.000 0.000 0.000 0.000 _parser.py:231(__next)
690 0.000 0.000 0.000 0.000 _parser.py:162(__getitem__)
575 0.000 0.000 0.000 0.000 _parser.py:252(get)
540 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:244(_verbose_message)
531 0.000 0.000 0.001 0.000 <frozen importlib._bootstrap_external>:126(_path_join)
531 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:128(<listcomp>)
303 0.000 0.000 0.000 0.000 {built-in method builtins.print}
296 0.000 0.000 0.000 0.000 {built-in method builtins.min}
268 0.000 0.000 0.000 0.000 _parser.py:247(match)
217 0.000 0.000 0.000 0.000 _parser.py:158(__len__)
```
```
45 changes: 45 additions & 0 deletions src/tests/PERF_PROBES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

<details open>
<summary>v1.0.1</summary>

```bash
python3 -m cProfile -s cumulative ./src/pnk/__main__.py -c < ./src/tests/list.txt
3205288 function calls (2946470 primitive calls) in 0.816 seconds

ncalls tottime percall cumtime percall filename:lineno(function)
19/1 0.000 0.000 0.816 0.816 {built-in method builtins.exec}
1 0.000 0.000 0.816 0.816 __main__.py:1(<module>)
1 0.000 0.000 0.806 0.806 __main__.py:38(main)
1 0.071 0.071 0.802 0.802 core.py:95(run)
395584/137343 0.294 0.000 0.539 0.000 core.py:87(join_product_tuples)
928811 0.154 0.000 0.245 0.000 __init__.py:1467(debug)
138221 0.152 0.000 0.152 0.000 {built-in method builtins.print}
928811 0.092 0.000 0.092 0.000 __init__.py:1734(isEnabledFor)
397220 0.022 0.000 0.022 0.000 {method 'join' of 'str' objects}
396815/396692 0.016 0.000 0.016 0.000 {built-in method builtins.len}
29/4 0.000 0.000 0.012 0.003 <frozen importlib._bootstrap>:1167(_find_and_load)
29/4 0.000 0.000 0.012 0.003 <frozen importlib._bootstrap>:1122(_find_and_load_unlocked)
23/4 0.000 0.000 0.012 0.003 <frozen importlib._bootstrap>:666(_load_unlocked)
17/4 0.000 0.000 0.012 0.003 <frozen importlib._bootstrap_external>:934(exec_module)
57/8 0.000 0.000 0.011 0.001 <frozen importlib._bootstrap>:233(_call_with_frames_removed)
1 0.000 0.000 0.008 0.008 core.py:1(<module>)
2 0.000 0.000 0.004 0.002 {built-in method builtins.__import__}
5/4 0.000 0.000 0.004 0.001 <frozen importlib._bootstrap>:1209(_handle_fromlist)
1 0.000 0.000 0.004 0.004 logger.py:1(<module>)
4 0.000 0.000 0.004 0.001 __init__.py:1(<module>)
29 0.000 0.000 0.003 0.000 <frozen importlib._bootstrap>:1056(_find_spec)
60 0.000 0.000 0.003 0.000 __init__.py:272(_compile)
1 0.000 0.000 0.003 0.003 __main__.py:13(setup_argparse)
1 0.000 0.000 0.003 0.003 pathlib.py:1(<module>)
12 0.000 0.000 0.003 0.000 _compiler.py:738(compile)
104/102 0.001 0.000 0.003 0.000 {built-in method builtins.__build_class__}
26 0.000 0.000 0.003 0.000 <frozen importlib._bootstrap_external>:1496(find_spec)
26 0.000 0.000 0.003 0.000 <frozen importlib._bootstrap_external>:1464(_get_spec)
1 0.000 0.000 0.003 0.003 argparse.py:1730(__init__)
5 0.000 0.000 0.003 0.001 argparse.py:1412(add_argument)
139 0.001 0.000 0.003 0.000 <frozen importlib._bootstrap_external>:1604(find_spec)
36 0.000 0.000 0.003 0.000 __init__.py:225(compile)
3 0.000 0.000 0.003 0.001 argparse.py:2580(_get_formatter)
3 0.000 0.000 0.003 0.001 argparse.py:164(__init__)
```
</details>
1 change: 1 addition & 0 deletions src/tests/list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ aws3-3m1.tesla.com
soho.v.2r.mail.ru
d4.c9.bf.a0.top.mail.ru
v.d1-4.c9.bf.a0.top.mail.ru
of-r1-gi0-0-171.tcsbank.ru

0 comments on commit e5a9a61

Please sign in to comment.