From 92c2270a29ee3bba762fd7cd4c8fb80ca5a10178 Mon Sep 17 00:00:00 2001 From: bd Date: Sun, 17 Aug 2025 21:18:12 -0400 Subject: Add changes accompanying completion of paper. --- aergia/aergia.py | 25 +- jupyter/yappi_aergia_in_depth.ipynb | 5681 ++++++++++++++++++++++++++++++++--- t/test_functionality.py | 15 + t/test_yappi_adaptations.py | 1 + t/utils.py | 15 +- 5 files changed, 5375 insertions(+), 362 deletions(-) diff --git a/aergia/aergia.py b/aergia/aergia.py index fcff1c7..df323b0 100755 --- a/aergia/aergia.py +++ b/aergia/aergia.py @@ -96,6 +96,8 @@ class Aergia(object): total_samples = 0 # the (ideal) interval between samples signal_interval = 0.0 + # the timestamp which the last sample was taken + last_sample = None # the current task for the loop being processed current_task = None @@ -117,6 +119,7 @@ class Aergia(object): in `Aergia._get_idle_task_frames'. The TimerHandler object otherwise does not keep track of a _source_traceback. ''' + Aergia.last_sample = time.perf_counter() signal.signal(signal.SIGALRM, Aergia._idle_signal_handler) signal.setitimer(signal.ITIMER_REAL, @@ -143,7 +146,7 @@ class Aergia(object): '''Pretty-print profiling results.''' if Aergia.total_samples > 0: print(f"{'FILE':<30} {'FUNC':<30}" - f" {'PERC':<8} {'(ACTUAL -> SEC)':<10}") + f" {'PERC':<8} {'SEC':<10}") for key in Aergia._sort_samples(Aergia.samples): Aergia.print_sample(key) else: @@ -156,15 +159,18 @@ class Aergia(object): sig_intv = Aergia.signal_interval value = Aergia.samples[key] print(f"{Aergia._tuple_to_string(key)} {value * 100 / Aergia.total_samples:.3f}% " - f" ({value:.3f} -> {value*sig_intv:.6f})") + f" {value*sig_intv:.6f}") @staticmethod def _idle_signal_handler(sig, frame): '''Obtains and records which lines are currently being waited on.''' + curr_sample = time.perf_counter() + passed_time = curr_sample - Aergia.last_sample keys = Aergia._compute_frames_to_record() for key in keys: - Aergia.samples[Aergia._frame_to_tuple(key)] += 1 - Aergia.total_samples += 1 + Aergia.samples[Aergia._frame_to_tuple(key)] += passed_time + Aergia.total_samples += passed_time + Aergia.last_sample = curr_sample @staticmethod def _compute_frames_to_record(): @@ -318,7 +324,11 @@ class Aergia(object): if any( Aergia._task_is_valid(task) for task in tasks - ): + ) or (tasks and all( + # if all the tasks are done, + getattr(task, '_state', None) == "FINISHED" + for task in tasks + )): return None return deepest_frame @@ -396,11 +406,6 @@ class Aergia(object): return False return True - @staticmethod - def _gettime(): - '''returns the wallclock time''' - return time.process_time() - the_globals = { '__name__': '__main__', diff --git a/jupyter/yappi_aergia_in_depth.ipynb b/jupyter/yappi_aergia_in_depth.ipynb index 5be3d5d..9586700 100644 --- a/jupyter/yappi_aergia_in_depth.ipynb +++ b/jupyter/yappi_aergia_in_depth.ipynb @@ -7,9 +7,9 @@ "source": [ "Instrumentation of code often results in what is known as the 'probing' effect. Collecting data about function runtime with instrumentation, as Yappi does, may cause the profiled code to not run correctly or run more slowly, distorting the measured results. The SCALENE paper shows that sampling-based profilers are capable of outperforming instrumentation in this regard.\n", "\n", - "Yet yappi supports asyncio, while no sampling based profiler does so far. This is where the prototype profiler Aergia comes in---it has basic support for all sort of programs, but really prioritizes assigning time to suspended asyncio tasks, allowing developers to access whether lingering asyncio tasks cause slowdown in their programs.\n", + "Yappi fully supports asyncio, while no sampling based profiler does so far. This is where the prototype profiler Aergia comes in---it has basic support for all sort of programs, but really prioritizes assigning time to suspended asyncio tasks, allowing developers insight into the efficiency of their event loop.\n", "\n", - "This notebook attempts to demonstrate that Aergia not only works, but provides undistorted and more useful results than Yappi." + "This notebook attempts to demonstrate that Aergia is comparable to Yappi, while also avoiding the probe effect characteristic of deterministic profilers." ] }, { @@ -41,7 +41,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "['/gnu/store/c5qarpvwzcz1idryvvpiqd7738jn4rs1-python-3.11.11/lib/python311.zip', '/gnu/store/c5qarpvwzcz1idryvvpiqd7738jn4rs1-python-3.11.11/lib/python3.11', '/gnu/store/c5qarpvwzcz1idryvvpiqd7738jn4rs1-python-3.11.11/lib/python3.11/lib-dynload', '', '/home/bdunahu/.local/lib/python3.11/site-packages', '/gnu/store/xxbyri1xnragvkcrfnzsw5akp3c1hwfh-python-notebook-6.5.7/lib/python3.11/site-packages', '/gnu/store/x8l5b47rka6ydfh0vfscr3i8gxw781zc-python-coverage-7.6.8/lib/python3.11/site-packages', '/gnu/store/v6vh0jxzd595b2gwj6h18slyz5ip6gkd-python-jupyter-server-2.14.0/lib/python3.11/site-packages', '/gnu/store/xzmds8gm2hqs1nv71s1bx87lb1pm1rc3-python-nbval-0.11.0/lib/python3.11/site-packages', '/gnu/store/ihha82cm6xh1g7692k8wlf7fcp24j0kv-python-pytest-8.3.3/lib/python3.11/site-packages', '/gnu/store/21qdhfn1s445ci3jmpr1dbc8kpjhzhci-python-pytest-cov-6.0.0/lib/python3.11/site-packages', '/gnu/store/dq5vkwzc8xvl4q3hww16ic3j5q1hfjc4-python-requests-2.31.0/lib/python3.11/site-packages', '/gnu/store/avv06v3cfanxwi3c7y39f56k8g5nx6ab-python-requests-unixsocket2-0.4.2/lib/python3.11/site-packages', '/gnu/store/d7c41kl3qkynmiwcyj26fppwckifd3hq-python-setuptools-67.6.1/lib/python3.11/site-packages', '/gnu/store/8af8k4p93zahcfndz160m20bfrlf5h4l-python-wheel-0.40.0/lib/python3.11/site-packages', '/gnu/store/ycqwsapbkpmwnfinfdfyc30jsadp6drc-python-argon2-cffi-21.1.0/lib/python3.11/site-packages', '/gnu/store/mar5wcakna02zdmn0izwdl19krm3grj5-python-ipykernel-6.29.4/lib/python3.11/site-packages', '/gnu/store/z9yyzbh2kfd19yysnk7iyhasfs8wgwi2-python-ipython-genutils-0.1.0/lib/python3.11/site-packages', '/gnu/store/bk2bgyy9nwl5x55dvfsfysi34l2jwwf5-python-jinja2-3.1.2/lib/python3.11/site-packages', '/gnu/store/001ii1n5b4cvbi46hqpdas1286lczxv3-python-jupyter-client-7.4.4/lib/python3.11/site-packages', '/gnu/store/aki05mqn67aw0yyy3pjcsgwwqprr24cw-python-jupyter-core-5.7.2/lib/python3.11/site-packages', '/gnu/store/gwbjk09d3g7lw636zk8dfvlfkyisrrzp-python-nest-asyncio-1.5.5/lib/python3.11/site-packages', '/gnu/store/vvancsvy0qp471jcab6a5blmmp9vbk4i-python-nbclassic-1.0.0/lib/python3.11/site-packages', '/gnu/store/l97g5r6mcqr1s4z7v3cyxs71z3y10g0x-python-nbconvert-7.16.4/lib/python3.11/site-packages', '/gnu/store/1l417pwxsggks86x9fimnfav7b86cjfn-python-nbformat-5.10.4/lib/python3.11/site-packages', '/gnu/store/pi5bvn8iyv098ap6nx50j3sgkwcy43m4-python-prometheus-client-0.20.0/lib/python3.11/site-packages', '/gnu/store/vy0dc7a2fm7ry9y4dcmfhc9wdpd5zi8y-python-pyzmq-25.1.0/lib/python3.11/site-packages', '/gnu/store/h2517sx6jg6a3vvkrmvm2v9b4q1x6lkw-python-send2trash-1.8.2/lib/python3.11/site-packages', '/gnu/store/7m1wxcm5ly0lg1jj099ggw7jfs3sfc46-python-terminado-0.10.0/lib/python3.11/site-packages', '/gnu/store/simm56r07r2g6hc4qkz8vvp4zdwc51ps-python-tornado-6.4.2/lib/python3.11/site-packages', '/gnu/store/rnhjwjwfgjm511bdsi638b3bi90h4cj1-python-traitlets-5.14.1/lib/python3.11/site-packages', '/gnu/store/3nnkbl90qk9l7a757ldxjdxyz73p0b9c-python-3.11.11/lib/python3.11/site-packages', '/gnu/store/50w8avb4mdmfqddpkjydiiv95v3xjds5-python-tomli-2.1.0/lib/python3.11/site-packages', '/gnu/store/g8ycyd5jvjw6g2h3sppj2ac2y86kyhbg-python-websocket-client-1.8.0/lib/python3.11/site-packages', '/gnu/store/0m54sa414acswx0i119dnim4hsdamcnx-python-packaging-24.2/lib/python3.11/site-packages', '/gnu/store/r95sk8cjyz7w40dhl1qdcqvfdm41d6mf-python-overrides-7.7.0/lib/python3.11/site-packages', '/gnu/store/npszb6i1683ya9idsgdcjibkxxpjzsnj-python-jupyter-server-terminals-0.5.3/lib/python3.11/site-packages', '/gnu/store/adsbnzagyxsvabr3kzjhnanmmz85i2ir-python-jupyter-events-0.10.0/lib/python3.11/site-packages', '/gnu/store/libv00bm613n92mhmyy95sh70aw0q7gb-python-anyio-4.6.2/lib/python3.11/site-packages', '/gnu/store/j3vk0v15cvmn3qvgm4mpyxik82h0rdlr-python-six-1.16.0/lib/python3.11/site-packages', '/gnu/store/l7mf7i7r2w18xsb2b3r6gk2674nn4a7m-python-py-1.11.0/lib/python3.11/site-packages', '/gnu/store/m7yld8jfs03s5dhlgp292p7ifwp43j17-python-pluggy-1.5.0/lib/python3.11/site-packages', '/gnu/store/djlwr8zkx7bmviypfbh7nwkg57ysdmp6-python-exceptiongroup-1.1.1/lib/python3.11/site-packages', '/gnu/store/3xlb5f0cvhrl2202frr3hqavfdjwdzx4-python-packaging-bootstrap-24.2/lib/python3.11/site-packages', '/gnu/store/cqw0fmfhyqxlvyizv2cqc5y3qh1ywa9s-python-iniconfig-1.1.1/lib/python3.11/site-packages', '/gnu/store/1d7kn9ldv5idlh3bb8a7yajryc8f3ppk-python-attrs-bootstrap-24.2.0/lib/python3.11/site-packages', '/gnu/store/rbj89mvacjvqfsj0bkapafc0zfqcjm4q-python-urllib3-2.2.1/lib/python3.11/site-packages', '/gnu/store/1kmaa5nl0ih4nqbqcif8rgv17iq7dvms-python-idna-3.3/lib/python3.11/site-packages', '/gnu/store/2b7ry0xs541z0ibl9rf5h0jnzvn1pmd0-python-charset-normalizer-2.1.0/lib/python3.11/site-packages', '/gnu/store/vdvcyy897wjk6s39ji3rahaga7v8ki7h-python-certifi-2022.6.15/lib/python3.11/site-packages', '/gnu/store/s4a0g9bjivgyw4sy7zyy5qbswaykaria-python-pbr-5.5.1/lib/python3.11/site-packages', '/gnu/store/hpajypigh3iaq0zw6vcw1jdzmdq1j962-python-typing-extensions-4.12.2/lib/python3.11/site-packages', '/gnu/store/jm1r2v84pfp28njl3agxaj4nmnwpzjs0-python-cffi-1.17.1/lib/python3.11/site-packages', '/gnu/store/qmgmik8rc44f8v5d33smzg6cwgrbvip4-python-psutil-5.9.2/lib/python3.11/site-packages', '/gnu/store/cbhkc48vmbam1bli524ycmia6v55piba-python-matplotlib-inline-0.1.3/lib/python3.11/site-packages', '/gnu/store/f3p7w5aics740njc5w2z9f4b6vi2w6s4-python-ipython-8.29.0/lib/python3.11/site-packages', '/gnu/store/1hza9x63v2ji75kb8kdha78zqkh5ny34-python-debugpy-1.8.9/lib/python3.11/site-packages', '/gnu/store/0ry8mwms6sxy94kcy4v1hzrxd6j45yyc-python-comm-0.2.2/lib/python3.11/site-packages', '/gnu/store/yzhc3lsqn8gwjs5vyvxk551s0fkly664-python-markupsafe-2.1.1/lib/python3.11/site-packages', '/gnu/store/gjhl4ggs0m9hggna0xy47c03mc88f2rd-python-entrypoints-0.3/lib/python3.11/site-packages', '/gnu/store/fazc70c4gxqgk7fh0gyd4n8i9p3x2y56-python-dateutil-2.8.2/lib/python3.11/site-packages', '/gnu/store/1ii8v3vbzlxk9ngdrawmckscfa731rl4-python-platformdirs-4.3.6/lib/python3.11/site-packages', '/gnu/store/bznlrpf2y32dx17067ybda2qs2px9p42-python-notebook-shim-0.2.4/lib/python3.11/site-packages', '/gnu/store/3il19ff54zw2pds9a9w2cv14l90hjrnh-python-tinycss2-1.4.0/lib/python3.11/site-packages', '/gnu/store/fqf4najfm6yp6baml031f48dbvali63f-python-pygments-2.15.1/lib/python3.11/site-packages', '/gnu/store/k1aq0v4fhd4gv5q30kv6ivjn33rn2hv7-python-pandocfilters-1.5.0/lib/python3.11/site-packages', '/gnu/store/p0287p1jclml4sqhqbzghrj7fr5yl2cp-python-nbclient-0.10.0/lib/python3.11/site-packages', '/gnu/store/67pfbf7dkw8l7qy9gj9c2crw5kwwhk3y-python-mistune-3.0.2/lib/python3.11/site-packages', '/gnu/store/zkx6skh4zgnw69jfbdwv7038mhjar3wi-python-jupyterlab-pygments-0.1.2/lib/python3.11/site-packages', '/gnu/store/s3w3q7m4xgvvc1fycakcb2853i4vlgpp-python-importlib-metadata-5.2.0/lib/python3.11/site-packages', '/gnu/store/4wlr8i0ha615n6x2399d8nx3wi8nhfgs-python-defusedxml-0.7.1/lib/python3.11/site-packages', '/gnu/store/5lpdkbk4imssqxis6m3nr21a4l25zcfr-python-bleach-6.0.0/lib/python3.11/site-packages', '/gnu/store/28kii7vzz482p40pb24ympk2sfkpmj9n-python-beautifulsoup4-4.12.3/lib/python3.11/site-packages', '/gnu/store/s4a48y50yl4fifs1ss7haih74idkgjzh-python-jsonschema-4.23.0/lib/python3.11/site-packages', '/gnu/store/y0mbna4yqxjlrx925p6gzmc3ii1f91d7-python-fastjsonschema-2.20.0/lib/python3.11/site-packages', '/gnu/store/0gjwdiaxwzzgyvd0z4mxhzg154bfsz33-python-ptyprocess-0.7.0/lib/python3.11/site-packages', '/gnu/store/7wgwzr1i93kyvy8i35lwm08ijics096l-python-pyparsing-3.2.1/lib/python3.11/site-packages', '/gnu/store/b3i5mf6v75zp4qdsf8psi5vdzmhkzla3-python-rfc3986-validator-0.1.1/lib/python3.11/site-packages', '/gnu/store/pffrql3h4wl693xhc69090h5fndil9dz-python-rfc3339-validator-0.1.4/lib/python3.11/site-packages', '/gnu/store/dx72kp642qfx96b917svywlbc6flmigc-python-rich-13.7.1/lib/python3.11/site-packages', '/gnu/store/z6ygq5raj9qkrykm3ypiimj3f536wz07-python-referencing-0.35.1/lib/python3.11/site-packages', '/gnu/store/b79n68m9pa68rs07ngra1c3a9b3xi1qv-python-pyyaml-6.0.1/lib/python3.11/site-packages', '/gnu/store/c29z1izy27z0p0msq190csdm8i2as5l8-python-json-logger-2.0.7/lib/python3.11/site-packages', '/gnu/store/ys4rj84grbhahdmgvdyh6rzxkj74g39m-python-sniffio-1.3.1/lib/python3.11/site-packages', '/gnu/store/xqlf1fslnysndampyfqkkhy5db6dx16m-python-contextvars-2.4/lib/python3.11/site-packages', '/gnu/store/iz01ddzyva0qf1iyrzdxaldprrd072pi-python-six-bootstrap-1.16.0/lib/python3.11/site-packages', '/gnu/store/diwaq9r0acrxiigwhjbrwhqlhyzlky4p-python-pysocks-1.7.1/lib/python3.11/site-packages', '/gnu/store/cfyyq8d8549ska921irv13gih0mfv5p0-python-pyopenssl-24.3.0/lib/python3.11/site-packages', '/gnu/store/gg9bqfa5gyxjy94iznsnc3mmivm89l7q-python-cryptography-44.0.0/lib/python3.11/site-packages', '/gnu/store/7qbsfm3pzcc73cvqdj2755d8wkqhjmil-python-pycparser-2.21/lib/python3.11/site-packages', '/gnu/store/smb71frir4ijdpwpk85rckcd3n4asr5y-python-matplotlib-3.8.2/lib/python3.11/site-packages', '/gnu/store/1fa60irxxdidvh685m4fpyaqxcnxh1sp-python-stack-data-0.6.3/lib/python3.11/site-packages', '/gnu/store/wlgbwr1wxi0fn8kk4qj1j2yncwdgj8cq-python-prompt-toolkit-3.0.43/lib/python3.11/site-packages', '/gnu/store/aacdlvzdnv3bv8jnkmss9b5v148rzl92-python-pexpect-4.9.0/lib/python3.11/site-packages', '/gnu/store/c5dr3hm1nv43gpyh13z97fkb13sy35gm-python-jedi-0.19.2/lib/python3.11/site-packages', '/gnu/store/ky32ynvbqxwyqakwyk0hj2nl60ahi157-python-decorator-5.0.9/lib/python3.11/site-packages', '/gnu/store/sx5g7545dvffcai9wvmj1jd3vzk69nbn-python-colorama-0.4.6/lib/python3.11/site-packages', '/gnu/store/szxayp9cjs68f2mmrym67r5r1hhf53rc-python-pydevd-3.2.3/lib/python3.11/site-packages', '/gnu/store/3r4vfjk4d1w6q37s8kpj1jll45gjdhlb-python-webencodings-0.5.1/lib/python3.11/site-packages', '/gnu/store/i3sfl4fjan7f7ixg7rbm99wqvmbhdbjj-python-zipp-1.0.0/lib/python3.11/site-packages', '/gnu/store/f245zik0hby777kikcrcdfycd196dlb6-python-html5lib-1.1/lib/python3.11/site-packages', '/gnu/store/j7cxak4y2a62k2i8ikq0msy87rk1arsh-python-lxml-5.2.2/lib/python3.11/site-packages', '/gnu/store/r73gfkjy67zhyh8p2gpbr3x3b03nmr08-python-soupsieve-2.2.1/lib/python3.11/site-packages', '/gnu/store/pabwbhbx55jp0s1nq18ha5px0i1qc0d6-python-webcolors-24.11.1/lib/python3.11/site-packages', '/gnu/store/7sim1sl86wlzlzl64mia57vdg2g13dfx-python-uri-template-1.3.0/lib/python3.11/site-packages', '/gnu/store/8w31cq1km280z7ihgs2y1gjnw8a9kn5q-python-rpds-py-0.10.6/lib/python3.11/site-packages', '/gnu/store/q3dnvg841zcc42h17lkkzdk1db8ydj7y-python-referencing-bootstrap-0.35.1/lib/python3.11/site-packages', '/gnu/store/zvxli58ld1nr01pnllvlkl5gmyzabr4s-python-jsonschema-specifications-2024.10.1/lib/python3.11/site-packages', '/gnu/store/gsw4ykif32dvi6qkp2gz9xvpjc0s81gc-python-jsonpointer-1.14/lib/python3.11/site-packages', '/gnu/store/7acqbdccam1kmbhj534zw4fqdspc948h-python-isoduration-20.11.0/lib/python3.11/site-packages', '/gnu/store/yk41d5vgxkf8j8g7xadldrnfs0chrwqf-python-importlib-resources-5.12.0/lib/python3.11/site-packages', '/gnu/store/2mvwx9qjiwqxb6akzjiv6lz13ayg57a8-python-fqdn-1.5.1/lib/python3.11/site-packages', '/gnu/store/hkf1b0xdiwrxwfvs1a066fl4j8mzckfb-python-attrs-24.2.0/lib/python3.11/site-packages', '/gnu/store/lqim3jja3zyqavc5rkl5n0qxyvl082jd-python-markdown-it-py-3.0.0/lib/python3.11/site-packages', '/gnu/store/mns86p157znl6ld1wx93wqfrg109q0yi-python-immutables-0.21/lib/python3.11/site-packages', '/gnu/store/yv4n6ng492crwj9nq6bn0kjpzrix7vjp-python-3.11.11-tk/lib/python3.11/site-packages', '/gnu/store/786yxjm4wq3wff8xjkfm6wl946q4a9dc-python-pillow-11.1.0/lib/python3.11/site-packages', '/gnu/store/bx80nwddb0827ryrca0dx85nh4fn2b2x-python-numpy-1.26.4/lib/python3.11/site-packages', '/gnu/store/34y2dizg06p667xmjjcq47n84bimg74l-python-kiwisolver-1.4.6/lib/python3.11/site-packages', '/gnu/store/7r0bfbq1l90qsihhsqad4s5f3w63dhkv-python-fonttools-minimal-4.39.3/lib/python3.11/site-packages', '/gnu/store/6q1s56a6qnxh9b704b9y95jyxi15z3wy-python-cycler-0.10.0/lib/python3.11/site-packages', '/gnu/store/mng7minvpnn7fmyczjlwx3caq0lij5il-python-contourpy-1.3.2/lib/python3.11/site-packages', '/gnu/store/v3dvpj36qih2p1ipvzf0dh4flswswhb4-python-pure-eval-0.2.3/lib/python3.11/site-packages', '/gnu/store/z855h6njq66g87vxxi25rblky0yxnwd5-python-executing-2.1.0/lib/python3.11/site-packages', '/gnu/store/9qx4gnv4hz9gpq7q4zzlkhks3nx0p5w2-python-asttokens-2.4.1/lib/python3.11/site-packages', '/gnu/store/z710c9ibc3fnvc6wqys9jdz0al8w9dh7-python-wcwidth-0.2.13/lib/python3.11/site-packages', '/gnu/store/8rjg30isj2f3l0x6ypdg4nj3j1vzb2b1-python-parso-0.8.4/lib/python3.11/site-packages', '/gnu/store/2d7jpdwjjs8sqwck7cal3sd5p3mxc716-python-more-itertools-10.6.0/lib/python3.11/site-packages', '/gnu/store/m0mbw0x6265ydqpksdfws5qiaj83vlci-python-chardet-5.2.0/lib/python3.11/site-packages', '/gnu/store/w0hl7d5867napkafsp85qz15xnswslgz-python-arrow-1.2.3/lib/python3.11/site-packages', '/gnu/store/izkankkiazd6b1xbi1sfshbv0yss7nxz-python-cached-property-2.0.1/lib/python3.11/site-packages', '/gnu/store/ff9af39qhmapj6b2ppkgs1rkgvadyiq4-python-panflute-2.3.0/lib/python3.11/site-packages', '/gnu/store/9dvbnq602glhvrbk6lqbaxd4ifn8grvh-python-mistletoe-1.3.0/lib/python3.11/site-packages', '/gnu/store/nzj6nf797zsh1az7i85g1f8h6yfd85jm-python-mdurl-0.1.2/lib/python3.11/site-packages', '/gnu/store/fbb83fjfkqgjl66qjpm019ars526fj8w-python-markdown-3.3.4/lib/python3.11/site-packages', '/gnu/store/hnj9qg4ybrqd4rj406psf8mzc7rpiwn3-python-linkify-it-py-2.0.0/lib/python3.11/site-packages', '/gnu/store/y8caisgjifxa4aqpiaxdwjhy449f2l1p-python-commonmark-0.9.1/lib/python3.11/site-packages', '/gnu/store/vrsxnwwmbslhlv4500whcdg6wfkbqb53-python-click-8.1.7/lib/python3.11/site-packages', '/gnu/store/7h80aql8fkvlnq5ywwpvil5yjldfv40l-python-uc-micro-py-1.0.1/lib/python3.11/site-packages', '/gnu/store/9sscnmx9s0b66chv2nd3wc110fqmk01c-python-hatchling-1.26.1/lib/python3.11/site-packages', '/gnu/store/i11m2aa9nks0mxn4gdy6xk1bgsxa60n5-python-pip-23.1/lib/python3.11/site-packages', '/gnu/store/cl35ary861wgpcml6ivrvdcl30g2kzhy-python-pre-commit-3.7.1/lib/python3.11/site-packages', '/gnu/store/7f7an2qrzlv3hbl93qsgblpw4ajy4ymh-python-pytest-timeout-2.3.1/lib/python3.11/site-packages', '/gnu/store/r3fyqnr3a4laq2hzlx1jvfgn2a0cnig6-python-trove-classifiers-2024.10.21.16/lib/python3.11/site-packages', '/gnu/store/5li4bcywi3r9vas9pny8r3s1clwiz3g1-python-pathspec-0.11.1/lib/python3.11/site-packages', '/gnu/store/ff3x2cl0linkxwi5nd073yl1r239m2wr-python-editables-0.5/lib/python3.11/site-packages', '/gnu/store/ksl6l8kg6zpcy58bxic0v6hkrp3gvqa3-python-virtualenv-20.29.1/lib/python3.11/site-packages', '/gnu/store/lll8f9srw4qpkn8f1d8jjwmrbcd2jd72-python-nodeenv-1.8.0/lib/python3.11/site-packages', '/gnu/store/ar9fvhmbmdfyvnaa84mn0pr9qn05wr9y-python-identify-2.5.36/lib/python3.11/site-packages', '/gnu/store/8mdgjh6w4160ra15nmwgbins0k6by0mk-python-cfgv-3.4.0/lib/python3.11/site-packages', '/gnu/store/8md4l2hkn46b213sbkpxprin8aa2g03h-python-filelock-3.16.1/lib/python3.11/site-packages', '/gnu/store/fg0wxqdwvd86xa8cmbcqbiqa756lakff-python-distlib-0.3.7/lib/python3.11/site-packages', '/gnu/store/61sxpc8fx54qq7syhrfg444mx61gnyaa-python-editdistance-0.3.1-1.3ea84a7/lib/python3.11/site-packages', '/gnu/store/6xi74zr92ljnw3n0agasasp46gqikrda-profile/lib/python3.11/site-packages', '/home/bdunahu/.guix-home/profile/lib/python3.11/site-packages', '/gnu/store/c5qarpvwzcz1idryvvpiqd7738jn4rs1-python-3.11.11/lib/python3.11/site-packages', '../aergia/']\n" + "['/gnu/store/c5qarpvwzcz1idryvvpiqd7738jn4rs1-python-3.11.11/lib/python311.zip', '/gnu/store/c5qarpvwzcz1idryvvpiqd7738jn4rs1-python-3.11.11/lib/python3.11', '/gnu/store/c5qarpvwzcz1idryvvpiqd7738jn4rs1-python-3.11.11/lib/python3.11/lib-dynload', '', '/home/bdunahu/.local/lib/python3.11/site-packages', '/gnu/store/8gcczykad73pbymiz28w594gqc2mcm7g-python-notebook-6.5.7/lib/python3.11/site-packages', '/gnu/store/x8l5b47rka6ydfh0vfscr3i8gxw781zc-python-coverage-7.6.8/lib/python3.11/site-packages', '/gnu/store/dkkdj4k885l3sy6m12p0yf07r1hb5csp-python-jupyter-server-2.14.0/lib/python3.11/site-packages', '/gnu/store/9wv3kgs4xc3zvcki9sblqr42pdcxnf39-python-nbval-0.11.0/lib/python3.11/site-packages', '/gnu/store/ihha82cm6xh1g7692k8wlf7fcp24j0kv-python-pytest-8.3.3/lib/python3.11/site-packages', '/gnu/store/21qdhfn1s445ci3jmpr1dbc8kpjhzhci-python-pytest-cov-6.0.0/lib/python3.11/site-packages', '/gnu/store/mryfl1mwhyf1lri6km6y27c2kb1x4y3p-python-requests-2.31.0/lib/python3.11/site-packages', '/gnu/store/21gj6vmih8113hp07dnkxf53r8gz3kf8-python-requests-unixsocket2-0.4.2/lib/python3.11/site-packages', '/gnu/store/d7c41kl3qkynmiwcyj26fppwckifd3hq-python-setuptools-67.6.1/lib/python3.11/site-packages', '/gnu/store/8af8k4p93zahcfndz160m20bfrlf5h4l-python-wheel-0.40.0/lib/python3.11/site-packages', '/gnu/store/ycqwsapbkpmwnfinfdfyc30jsadp6drc-python-argon2-cffi-21.1.0/lib/python3.11/site-packages', '/gnu/store/0wx7mmnfb3dpsfkzfkhh9iflvjd8ihsg-python-ipykernel-6.29.4/lib/python3.11/site-packages', '/gnu/store/z9yyzbh2kfd19yysnk7iyhasfs8wgwi2-python-ipython-genutils-0.1.0/lib/python3.11/site-packages', '/gnu/store/bk2bgyy9nwl5x55dvfsfysi34l2jwwf5-python-jinja2-3.1.2/lib/python3.11/site-packages', '/gnu/store/bjfa91d5z29ygdx7w7bmz4969b0lfqkv-python-jupyter-client-7.4.4/lib/python3.11/site-packages', '/gnu/store/z9s2jvw8fb598s9brpm0wqgy6svxb691-python-jupyter-core-5.7.2/lib/python3.11/site-packages', '/gnu/store/gwbjk09d3g7lw636zk8dfvlfkyisrrzp-python-nest-asyncio-1.5.5/lib/python3.11/site-packages', '/gnu/store/anryryjr4p9pazpcb8aw82dby9dps3fi-python-nbclassic-1.0.0/lib/python3.11/site-packages', '/gnu/store/iji0b84gi65aaagypg06ah1cdqiwdsii-python-nbconvert-7.16.4/lib/python3.11/site-packages', '/gnu/store/akc5pxyrd4z14yvf00ys5aqb7hqpja2x-python-nbformat-5.10.4/lib/python3.11/site-packages', '/gnu/store/pi5bvn8iyv098ap6nx50j3sgkwcy43m4-python-prometheus-client-0.20.0/lib/python3.11/site-packages', '/gnu/store/vy0dc7a2fm7ry9y4dcmfhc9wdpd5zi8y-python-pyzmq-25.1.0/lib/python3.11/site-packages', '/gnu/store/h2517sx6jg6a3vvkrmvm2v9b4q1x6lkw-python-send2trash-1.8.2/lib/python3.11/site-packages', '/gnu/store/7m1wxcm5ly0lg1jj099ggw7jfs3sfc46-python-terminado-0.10.0/lib/python3.11/site-packages', '/gnu/store/simm56r07r2g6hc4qkz8vvp4zdwc51ps-python-tornado-6.4.2/lib/python3.11/site-packages', '/gnu/store/4aq408ifx2sc8d4ijs3ibkvac3f69y2p-python-traitlets-5.14.1/lib/python3.11/site-packages', '/gnu/store/3nnkbl90qk9l7a757ldxjdxyz73p0b9c-python-3.11.11/lib/python3.11/site-packages', '/gnu/store/50w8avb4mdmfqddpkjydiiv95v3xjds5-python-tomli-2.1.0/lib/python3.11/site-packages', '/gnu/store/g8ycyd5jvjw6g2h3sppj2ac2y86kyhbg-python-websocket-client-1.8.0/lib/python3.11/site-packages', '/gnu/store/0m54sa414acswx0i119dnim4hsdamcnx-python-packaging-24.2/lib/python3.11/site-packages', '/gnu/store/r95sk8cjyz7w40dhl1qdcqvfdm41d6mf-python-overrides-7.7.0/lib/python3.11/site-packages', '/gnu/store/npszb6i1683ya9idsgdcjibkxxpjzsnj-python-jupyter-server-terminals-0.5.3/lib/python3.11/site-packages', '/gnu/store/drszs8dx74zm0nr7xvfkvmsa568fh028-python-jupyter-events-0.10.0/lib/python3.11/site-packages', '/gnu/store/2g266m4i3mcjma0l7b51qsrvw4y9gkvy-python-anyio-4.6.2/lib/python3.11/site-packages', '/gnu/store/j3vk0v15cvmn3qvgm4mpyxik82h0rdlr-python-six-1.16.0/lib/python3.11/site-packages', '/gnu/store/l7mf7i7r2w18xsb2b3r6gk2674nn4a7m-python-py-1.11.0/lib/python3.11/site-packages', '/gnu/store/m7yld8jfs03s5dhlgp292p7ifwp43j17-python-pluggy-1.5.0/lib/python3.11/site-packages', '/gnu/store/djlwr8zkx7bmviypfbh7nwkg57ysdmp6-python-exceptiongroup-1.1.1/lib/python3.11/site-packages', '/gnu/store/3xlb5f0cvhrl2202frr3hqavfdjwdzx4-python-packaging-bootstrap-24.2/lib/python3.11/site-packages', '/gnu/store/cqw0fmfhyqxlvyizv2cqc5y3qh1ywa9s-python-iniconfig-1.1.1/lib/python3.11/site-packages', '/gnu/store/1d7kn9ldv5idlh3bb8a7yajryc8f3ppk-python-attrs-bootstrap-24.2.0/lib/python3.11/site-packages', '/gnu/store/fn9kh5z47nixnpdan1980ggndcp96zsh-python-urllib3-2.2.1/lib/python3.11/site-packages', '/gnu/store/1kmaa5nl0ih4nqbqcif8rgv17iq7dvms-python-idna-3.3/lib/python3.11/site-packages', '/gnu/store/2b7ry0xs541z0ibl9rf5h0jnzvn1pmd0-python-charset-normalizer-2.1.0/lib/python3.11/site-packages', '/gnu/store/vdvcyy897wjk6s39ji3rahaga7v8ki7h-python-certifi-2022.6.15/lib/python3.11/site-packages', '/gnu/store/j5lp5hkbcz7mqxgac1hgcm517bckb73b-python-pbr-5.5.1/lib/python3.11/site-packages', '/gnu/store/hpajypigh3iaq0zw6vcw1jdzmdq1j962-python-typing-extensions-4.12.2/lib/python3.11/site-packages', '/gnu/store/jm1r2v84pfp28njl3agxaj4nmnwpzjs0-python-cffi-1.17.1/lib/python3.11/site-packages', '/gnu/store/qmgmik8rc44f8v5d33smzg6cwgrbvip4-python-psutil-5.9.2/lib/python3.11/site-packages', '/gnu/store/yn165r281f7y7axx0wr8jc64gqkw28cf-python-matplotlib-inline-0.1.3/lib/python3.11/site-packages', '/gnu/store/1sr8ig20np4zxqx386ykpq0cg9b82zxy-python-ipython-8.29.0/lib/python3.11/site-packages', '/gnu/store/wawlwscyr7sza5s11h81y6iwvrwwkiqa-python-debugpy-1.8.9/lib/python3.11/site-packages', '/gnu/store/dx5wpfm0vyy4z7xv7dx3xqsvqwhkxpjq-python-comm-0.2.2/lib/python3.11/site-packages', '/gnu/store/yzhc3lsqn8gwjs5vyvxk551s0fkly664-python-markupsafe-2.1.1/lib/python3.11/site-packages', '/gnu/store/gjhl4ggs0m9hggna0xy47c03mc88f2rd-python-entrypoints-0.3/lib/python3.11/site-packages', '/gnu/store/fazc70c4gxqgk7fh0gyd4n8i9p3x2y56-python-dateutil-2.8.2/lib/python3.11/site-packages', '/gnu/store/1ii8v3vbzlxk9ngdrawmckscfa731rl4-python-platformdirs-4.3.6/lib/python3.11/site-packages', '/gnu/store/g3p96hgq4hhp5azr3xarcg5gamfscbqx-python-notebook-shim-0.2.4/lib/python3.11/site-packages', '/gnu/store/cxg3l0d9xdcxxj74ff4awmhk6ga3fywq-python-tinycss2-1.4.0/lib/python3.11/site-packages', '/gnu/store/fqf4najfm6yp6baml031f48dbvali63f-python-pygments-2.15.1/lib/python3.11/site-packages', '/gnu/store/k1aq0v4fhd4gv5q30kv6ivjn33rn2hv7-python-pandocfilters-1.5.0/lib/python3.11/site-packages', '/gnu/store/nnv9cqpcx27jymn7lvwnsg2gbvb3aynz-python-nbclient-0.10.0/lib/python3.11/site-packages', '/gnu/store/67pfbf7dkw8l7qy9gj9c2crw5kwwhk3y-python-mistune-3.0.2/lib/python3.11/site-packages', '/gnu/store/zkx6skh4zgnw69jfbdwv7038mhjar3wi-python-jupyterlab-pygments-0.1.2/lib/python3.11/site-packages', '/gnu/store/s3w3q7m4xgvvc1fycakcb2853i4vlgpp-python-importlib-metadata-5.2.0/lib/python3.11/site-packages', '/gnu/store/4wlr8i0ha615n6x2399d8nx3wi8nhfgs-python-defusedxml-0.7.1/lib/python3.11/site-packages', '/gnu/store/fva0pfjx8dpygg69cr1y4822x44ghckk-python-bleach-6.0.0/lib/python3.11/site-packages', '/gnu/store/28kii7vzz482p40pb24ympk2sfkpmj9n-python-beautifulsoup4-4.12.3/lib/python3.11/site-packages', '/gnu/store/8bl94jfrlzbfaar4why8prchscsjxv0w-python-jsonschema-4.23.0/lib/python3.11/site-packages', '/gnu/store/qbksi5islk7qz2v3wc85jxwx8znldybp-python-fastjsonschema-2.20.0/lib/python3.11/site-packages', '/gnu/store/0gjwdiaxwzzgyvd0z4mxhzg154bfsz33-python-ptyprocess-0.7.0/lib/python3.11/site-packages', '/gnu/store/7wgwzr1i93kyvy8i35lwm08ijics096l-python-pyparsing-3.2.1/lib/python3.11/site-packages', '/gnu/store/mn51ag3b29p9bvlm8w4208nqqvjcg96q-python-rfc3986-validator-0.1.1/lib/python3.11/site-packages', '/gnu/store/jlgp0fnl49gasgqhdzzj6a5a5f5pvgj2-python-rfc3339-validator-0.1.4/lib/python3.11/site-packages', '/gnu/store/6kkrn368ky8dmz7mciwfhvmaw12a6a9h-python-rich-13.7.1/lib/python3.11/site-packages', '/gnu/store/jvfidn54kx51qc9s2l3846w9w81zkrkj-python-referencing-0.35.1/lib/python3.11/site-packages', '/gnu/store/b79n68m9pa68rs07ngra1c3a9b3xi1qv-python-pyyaml-6.0.1/lib/python3.11/site-packages', '/gnu/store/c29z1izy27z0p0msq190csdm8i2as5l8-python-json-logger-2.0.7/lib/python3.11/site-packages', '/gnu/store/ys4rj84grbhahdmgvdyh6rzxkj74g39m-python-sniffio-1.3.1/lib/python3.11/site-packages', '/gnu/store/dvbnl28vw2fw0dlvhpg89hyj7l8ip2k8-python-contextvars-2.4/lib/python3.11/site-packages', '/gnu/store/iz01ddzyva0qf1iyrzdxaldprrd072pi-python-six-bootstrap-1.16.0/lib/python3.11/site-packages', '/gnu/store/diwaq9r0acrxiigwhjbrwhqlhyzlky4p-python-pysocks-1.7.1/lib/python3.11/site-packages', '/gnu/store/ll6g7b9vxzfy62gh3pa520b59fdzv1z4-python-pyopenssl-24.3.0/lib/python3.11/site-packages', '/gnu/store/vkd8q5q3snswznfra0k1ri2sawf3hn6r-python-cryptography-44.0.0/lib/python3.11/site-packages', '/gnu/store/7qbsfm3pzcc73cvqdj2755d8wkqhjmil-python-pycparser-2.21/lib/python3.11/site-packages', '/gnu/store/3w17ixn6p10dbqgkilz20m1g9najdl5v-python-matplotlib-3.8.2/lib/python3.11/site-packages', '/gnu/store/8c5cfz99zm85zkv8gms61w06xhzn9j97-python-stack-data-0.6.3/lib/python3.11/site-packages', '/gnu/store/wlgbwr1wxi0fn8kk4qj1j2yncwdgj8cq-python-prompt-toolkit-3.0.43/lib/python3.11/site-packages', '/gnu/store/sbcqdb38vqgvni2mpzn0df00nscn7ba7-python-pexpect-4.9.0/lib/python3.11/site-packages', '/gnu/store/c5dr3hm1nv43gpyh13z97fkb13sy35gm-python-jedi-0.19.2/lib/python3.11/site-packages', '/gnu/store/ky32ynvbqxwyqakwyk0hj2nl60ahi157-python-decorator-5.0.9/lib/python3.11/site-packages', '/gnu/store/sx5g7545dvffcai9wvmj1jd3vzk69nbn-python-colorama-0.4.6/lib/python3.11/site-packages', '/gnu/store/nl62s39bdjv0wpnk4az3b2mnm71a1xw3-python-pydevd-3.2.3/lib/python3.11/site-packages', '/gnu/store/3r4vfjk4d1w6q37s8kpj1jll45gjdhlb-python-webencodings-0.5.1/lib/python3.11/site-packages', '/gnu/store/i3sfl4fjan7f7ixg7rbm99wqvmbhdbjj-python-zipp-1.0.0/lib/python3.11/site-packages', '/gnu/store/f245zik0hby777kikcrcdfycd196dlb6-python-html5lib-1.1/lib/python3.11/site-packages', '/gnu/store/j7cxak4y2a62k2i8ikq0msy87rk1arsh-python-lxml-5.2.2/lib/python3.11/site-packages', '/gnu/store/r73gfkjy67zhyh8p2gpbr3x3b03nmr08-python-soupsieve-2.2.1/lib/python3.11/site-packages', '/gnu/store/pabwbhbx55jp0s1nq18ha5px0i1qc0d6-python-webcolors-24.11.1/lib/python3.11/site-packages', '/gnu/store/7sim1sl86wlzlzl64mia57vdg2g13dfx-python-uri-template-1.3.0/lib/python3.11/site-packages', '/gnu/store/ffqxhrsxgwk4mryc02wqwr7bd5mz8k7h-python-rpds-py-0.10.6/lib/python3.11/site-packages', '/gnu/store/jwm3g5rcsy3k6w4q6syk8w7kda9dajr8-python-referencing-bootstrap-0.35.1/lib/python3.11/site-packages', '/gnu/store/zm437l9b9i4l2v104sgkfqff3rkh2irj-python-jsonschema-specifications-2024.10.1/lib/python3.11/site-packages', '/gnu/store/gsw4ykif32dvi6qkp2gz9xvpjc0s81gc-python-jsonpointer-1.14/lib/python3.11/site-packages', '/gnu/store/7acqbdccam1kmbhj534zw4fqdspc948h-python-isoduration-20.11.0/lib/python3.11/site-packages', '/gnu/store/r54812jhf9ws0hxnmk54s0y1g1ri92m1-python-importlib-resources-5.12.0/lib/python3.11/site-packages', '/gnu/store/2mvwx9qjiwqxb6akzjiv6lz13ayg57a8-python-fqdn-1.5.1/lib/python3.11/site-packages', '/gnu/store/hkf1b0xdiwrxwfvs1a066fl4j8mzckfb-python-attrs-24.2.0/lib/python3.11/site-packages', '/gnu/store/7x182vymw0sdd1ym52mb3pw0rlxh52zv-python-markdown-it-py-3.0.0/lib/python3.11/site-packages', '/gnu/store/5jkb6p28qykp1g3pbg8pqkzcxxzakw7x-python-immutables-0.21/lib/python3.11/site-packages', '/gnu/store/yv4n6ng492crwj9nq6bn0kjpzrix7vjp-python-3.11.11-tk/lib/python3.11/site-packages', '/gnu/store/fzr0qvwglnyfkwkhp2awa6qyqc9iggla-python-pillow-11.1.0/lib/python3.11/site-packages', '/gnu/store/pf1jgr4zjq9ah69s3hrgcp36cxxaj0qj-python-numpy-1.26.4/lib/python3.11/site-packages', '/gnu/store/34y2dizg06p667xmjjcq47n84bimg74l-python-kiwisolver-1.4.6/lib/python3.11/site-packages', '/gnu/store/7r0bfbq1l90qsihhsqad4s5f3w63dhkv-python-fonttools-minimal-4.39.3/lib/python3.11/site-packages', '/gnu/store/6q1s56a6qnxh9b704b9y95jyxi15z3wy-python-cycler-0.10.0/lib/python3.11/site-packages', '/gnu/store/cnk6flgsd9b6g9mywg2w8j3fgnvdmcf6-python-contourpy-1.3.2/lib/python3.11/site-packages', '/gnu/store/v3dvpj36qih2p1ipvzf0dh4flswswhb4-python-pure-eval-0.2.3/lib/python3.11/site-packages', '/gnu/store/z855h6njq66g87vxxi25rblky0yxnwd5-python-executing-2.1.0/lib/python3.11/site-packages', '/gnu/store/9qx4gnv4hz9gpq7q4zzlkhks3nx0p5w2-python-asttokens-2.4.1/lib/python3.11/site-packages', '/gnu/store/z710c9ibc3fnvc6wqys9jdz0al8w9dh7-python-wcwidth-0.2.13/lib/python3.11/site-packages', '/gnu/store/8rjg30isj2f3l0x6ypdg4nj3j1vzb2b1-python-parso-0.8.4/lib/python3.11/site-packages', '/gnu/store/2d7jpdwjjs8sqwck7cal3sd5p3mxc716-python-more-itertools-10.6.0/lib/python3.11/site-packages', '/gnu/store/m0mbw0x6265ydqpksdfws5qiaj83vlci-python-chardet-5.2.0/lib/python3.11/site-packages', '/gnu/store/w0hl7d5867napkafsp85qz15xnswslgz-python-arrow-1.2.3/lib/python3.11/site-packages', '/gnu/store/izkankkiazd6b1xbi1sfshbv0yss7nxz-python-cached-property-2.0.1/lib/python3.11/site-packages', '/gnu/store/xl94l93pld8bxbpdcxhbd7z8jasn3mha-python-panflute-2.3.0/lib/python3.11/site-packages', '/gnu/store/9dvbnq602glhvrbk6lqbaxd4ifn8grvh-python-mistletoe-1.3.0/lib/python3.11/site-packages', '/gnu/store/li646794v86v1c6wlhvffv29l7qljwz8-python-mdurl-0.1.2/lib/python3.11/site-packages', '/gnu/store/fbb83fjfkqgjl66qjpm019ars526fj8w-python-markdown-3.3.4/lib/python3.11/site-packages', '/gnu/store/hnj9qg4ybrqd4rj406psf8mzc7rpiwn3-python-linkify-it-py-2.0.0/lib/python3.11/site-packages', '/gnu/store/y8caisgjifxa4aqpiaxdwjhy449f2l1p-python-commonmark-0.9.1/lib/python3.11/site-packages', '/gnu/store/vrsxnwwmbslhlv4500whcdg6wfkbqb53-python-click-8.1.7/lib/python3.11/site-packages', '/gnu/store/7h80aql8fkvlnq5ywwpvil5yjldfv40l-python-uc-micro-py-1.0.1/lib/python3.11/site-packages', '/gnu/store/9sscnmx9s0b66chv2nd3wc110fqmk01c-python-hatchling-1.26.1/lib/python3.11/site-packages', '/gnu/store/i11m2aa9nks0mxn4gdy6xk1bgsxa60n5-python-pip-23.1/lib/python3.11/site-packages', '/gnu/store/k3y3iq5vb5n9v05gpl4m5fnhf4nxnqix-python-pre-commit-3.7.1/lib/python3.11/site-packages', '/gnu/store/b26wqy976fxvpirwaanh1blnavhkj12q-python-pytest-timeout-2.3.1/lib/python3.11/site-packages', '/gnu/store/r3fyqnr3a4laq2hzlx1jvfgn2a0cnig6-python-trove-classifiers-2024.10.21.16/lib/python3.11/site-packages', '/gnu/store/5li4bcywi3r9vas9pny8r3s1clwiz3g1-python-pathspec-0.11.1/lib/python3.11/site-packages', '/gnu/store/ff3x2cl0linkxwi5nd073yl1r239m2wr-python-editables-0.5/lib/python3.11/site-packages', '/gnu/store/5ga8dlgfy41ksmmzlpala7c81xppd9f2-python-virtualenv-20.29.1/lib/python3.11/site-packages', '/gnu/store/lll8f9srw4qpkn8f1d8jjwmrbcd2jd72-python-nodeenv-1.8.0/lib/python3.11/site-packages', '/gnu/store/ar9fvhmbmdfyvnaa84mn0pr9qn05wr9y-python-identify-2.5.36/lib/python3.11/site-packages', '/gnu/store/8mdgjh6w4160ra15nmwgbins0k6by0mk-python-cfgv-3.4.0/lib/python3.11/site-packages', '/gnu/store/8md4l2hkn46b213sbkpxprin8aa2g03h-python-filelock-3.16.1/lib/python3.11/site-packages', '/gnu/store/fg0wxqdwvd86xa8cmbcqbiqa756lakff-python-distlib-0.3.7/lib/python3.11/site-packages', '/gnu/store/61sxpc8fx54qq7syhrfg444mx61gnyaa-python-editdistance-0.3.1-1.3ea84a7/lib/python3.11/site-packages', '/gnu/store/d4yk6bf542xnzh260zfcb5lmg2lcv0is-profile/lib/python3.11/site-packages', '/home/bdunahu/.guix-home/profile/lib/python3.11/site-packages', '/gnu/store/c5qarpvwzcz1idryvvpiqd7738jn4rs1-python-3.11.11/lib/python3.11/site-packages', '../aergia/']\n" ] } ], @@ -102,7 +102,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "id": "591908f7", "metadata": {}, "outputs": [], @@ -133,12 +133,12 @@ "id": "af4924a8", "metadata": {}, "source": [ - "Yappi is a singleton class, which means it doesn't require much setup. However, it must be set to profile wall clock time rather than the default of cpu time, as Aergia cannot do CPU time:" + "Yappi is a singleton class, which means it doesn't require much setup. However, it must be set to profile wallclock time rather than the default of cpu time, as it does not report await statements in virtual time." ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "id": "1bd50c9e", "metadata": {}, "outputs": [], @@ -162,7 +162,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 6, "id": "ad7a7bd6", "metadata": {}, "outputs": [], @@ -187,7 +187,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 7, "id": "2b8b09ae", "metadata": {}, "outputs": [], @@ -197,7 +197,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 8, "id": "f94e192d", "metadata": {}, "outputs": [], @@ -247,7 +247,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 9, "id": "638bdada", "metadata": {}, "outputs": [], @@ -273,14 +273,14 @@ "output_type": "stream", "text": [ "FILE FUNC PERC (ACTUAL -> SEC)\n", - "ernel_32439/1510412079.py:2 snooze 33.333% (63.000 -> 0.630000)\n", - "kernel_32439/510785827.py:4 run_coro 33.333% (63.000 -> 0.630000)\n", - "kernel_32439/510785827.py:2 33.333% (63.000 -> 0.630000)\n", + "ernel_26033/1510412079.py:2 snooze 33.333% (63.000 -> 0.630000)\n", + "kernel_26033/510785827.py:4 run_coro 33.333% (63.000 -> 0.630000)\n", + "kernel_26033/510785827.py:2 33.333% (63.000 -> 0.630000)\n", "FILE FUNC SEC \n", - "kernel_32439/510785827.py:1 run_coro 0.6429 \n", - "kernel_32439/510785827.py:2 0.6420 \n", - "ernel_32439/1510412079.py:4 alarm 0.6386 \n", - "ernel_32439/1510412079.py:1 snooze 0.6384 \n" + "kernel_26033/510785827.py:1 run_coro 0.6444 \n", + "kernel_26033/510785827.py:2 0.6422 \n", + "ernel_26033/1510412079.py:4 alarm 0.6394 \n", + "ernel_26033/1510412079.py:1 snooze 0.6393 \n" ] } ], @@ -318,7 +318,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 10, "id": "8a15b19b", "metadata": {}, "outputs": [], @@ -330,19 +330,12 @@ " if s.name == func_name:\n", " return s.ttot\n", "\n", - "def aergia_expected_time(total_samples):\n", - " '''Given TOTAL_SAMPLES, returns the total time, using the\n", - " sampling interval.'''\n", - " return total_samples * aergia_interval\n", - "\n", "def aergia_extract_values_by_func(samples, func_name):\n", " '''Returns the total number of samples for function name, given an\n", " Aergia SAMPLES object.'''\n", - " return aergia_expected_time(\n", - " sum(\n", - " value for key, value in samples.items()\n", - " if key.func == func_name\n", - " )\n", + " return sum(\n", + " value for key, value in samples.items()\n", + " if key.func == func_name\n", " )" ] }, @@ -356,7 +349,17 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 11, + "id": "0dd177cf", + "metadata": {}, + "outputs": [], + "source": [ + "import time" + ] + }, + { + "cell_type": "code", + "execution_count": 12, "id": "09420196", "metadata": {}, "outputs": [], @@ -367,37 +370,47 @@ " FUNC_TO_PROFILE and returns the results.'''\n", " y_res = []\n", " a_res = []\n", + " t_res = []\n", " for n, i in enumerate(iterations):\n", " res = run_with_aergia(call(i), False)\n", " a_res.append(aergia_extract_values_by_func(res, func_to_profile))\n", "\n", " res = run_with_yappi(call(i), False)\n", " y_res.append(yappi_extract_values_by_func(res, func_to_profile))\n", + " \n", + " start = time.perf_counter()\n", + " run_coro(call(i))\n", + " t_res.append(time.perf_counter() - start)\n", "\n", " if ((n + 1) % 5 == 0):\n", " print(f'Completed iteration {n + 1}.')\n", " \n", - " return y_res, a_res" + " return y_res, a_res, t_res" ] }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 15, "id": "7141ba1c", "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "Completed iteration 5.\n" + "ename": "NameError", + "evalue": "name 'time' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[31m---------------------------------------------------------------------------\u001b[39m", + "\u001b[31mNameError\u001b[39m Traceback (most recent call last)", + "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[15]\u001b[39m\u001b[32m, line 3\u001b[39m\n\u001b[32m 1\u001b[39m iterations = \u001b[38;5;28mlist\u001b[39m(\u001b[38;5;28mrange\u001b[39m(\u001b[32m100\u001b[39m, \u001b[32m1000\u001b[39m, \u001b[32m200\u001b[39m))\n\u001b[32m----> \u001b[39m\u001b[32m3\u001b[39m yres, ares, tres = \u001b[43mcompare_coro\u001b[49m\u001b[43m(\u001b[49m\u001b[43malarm\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[33;43m'\u001b[39;49m\u001b[33;43msnooze\u001b[39;49m\u001b[33;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43miterations\u001b[49m\u001b[43m)\u001b[49m\n", + "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[14]\u001b[39m\u001b[32m, line 15\u001b[39m, in \u001b[36mcompare_coro\u001b[39m\u001b[34m(call, func_to_profile, iterations)\u001b[39m\n\u001b[32m 12\u001b[39m res = run_with_yappi(call(i), \u001b[38;5;28;01mFalse\u001b[39;00m)\n\u001b[32m 13\u001b[39m y_res.append(yappi_extract_values_by_func(res, func_to_profile))\n\u001b[32m---> \u001b[39m\u001b[32m15\u001b[39m start = \u001b[43mtime\u001b[49m.perf_counter()\n\u001b[32m 16\u001b[39m run_coro(call(i))\n\u001b[32m 17\u001b[39m t_res.append(time.perf_counter() - start)\n", + "\u001b[31mNameError\u001b[39m: name 'time' is not defined" ] } ], "source": [ "iterations = list(range(100, 1000, 200))\n", "\n", - "yres, ares = compare_coro(alarm, 'snooze', iterations)" + "yres, ares, tres = compare_coro(alarm, 'snooze', iterations)" ] }, { @@ -410,7 +423,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 13, "id": "cb5936dc", "metadata": { "scrolled": true @@ -422,7 +435,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 14, "id": "bca40c72", "metadata": {}, "outputs": [], @@ -430,15 +443,15 @@ "def plot_comp(func_name, iterations, aergia, yappi, ideal=None, color1='blue', color2='red', color3='green'):\n", " fig = go.Figure()\n", "\n", - " fig.add_trace(go.Scatter(x=iterations, y=aergia, mode='lines', name='aergia', line=dict(color=color1)))\n", - " fig.add_trace(go.Scatter(x=iterations, y=yappi, mode='lines', name='yappi', line=dict(color=color2)))\n", + " fig.add_trace(go.Scatter(x=iterations, y=aergia, mode='markers', name='aergia', marker=dict(color=color1)))\n", + " fig.add_trace(go.Scatter(x=iterations, y=yappi, mode='markers', name='yappi', marker=dict(color=color2)))\n", " if ideal:\n", " fig.add_trace(go.Scatter(x=iterations, y=ideal, mode='lines', name='ideal', line=dict(color=color3)))\n", "\n", "\n", " fig.update_layout(\n", " title=f'Reported Seconds for Coroutine {func_name}',\n", - " xaxis_title='tasks run simultaniously',\n", + " xaxis_title='number of suspends',\n", " yaxis_title='reported seconds',\n", " legend_title='Legend',\n", " )\n", @@ -449,41 +462,89 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 16, "id": "ced7211f", "metadata": { "scrolled": false }, "outputs": [ { - "data": { - "text/html": [ - " \n", - " " - ] - }, - "metadata": {}, - "output_type": "display_data" - }, + "ename": "NameError", + "evalue": "name 'iterations' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[31m---------------------------------------------------------------------------\u001b[39m", + "\u001b[31mNameError\u001b[39m Traceback (most recent call last)", + "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[16]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m plot_comp(\u001b[33m'\u001b[39m\u001b[33msnooze\u001b[39m\u001b[33m'\u001b[39m, \u001b[43miterations\u001b[49m, ares, yres, tres)\n", + "\u001b[31mNameError\u001b[39m: name 'iterations' is not defined" + ] + } + ], + "source": [ + "plot_comp('snooze', iterations, ares, yres, tres)" + ] + }, + { + "cell_type": "markdown", + "id": "e4c56ca9", + "metadata": {}, + "source": [ + "# asyncio.sleep (asynchronous)" + ] + }, + { + "cell_type": "markdown", + "id": "fe542ae5", + "metadata": {}, + "source": [ + "This code does the same as above, synchronously." + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "d5ae80e1", + "metadata": {}, + "outputs": [], + "source": [ + "async def alarm(times):\n", + " tasks = [snooze() for _ in range(times)]\n", + " await asyncio.gather(*tasks)" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "id": "45e9b10f", + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Completed iteration 5.\n", + "Completed iteration 10.\n", + "Completed iteration 15.\n", + "Completed iteration 20.\n", + "Completed iteration 25.\n", + "Completed iteration 30.\n", + "Completed iteration 35.\n" + ] + } + ], + "source": [ + "iterations = list(range(100, 4000, 100))\n", + "yres, ares, tres = compare_coro(alarm, 'snooze', iterations)" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "id": "e33c1263", + "metadata": {}, + "outputs": [ { "data": { "application/vnd.plotly.v1+json": { @@ -492,47 +553,183 @@ }, "data": [ { - "line": { + "marker": { "color": "blue" }, - "mode": "lines", + "mode": "markers", "name": "aergia", "type": "scatter", "x": [ 100, + 200, 300, + 400, 500, + 600, 700, - 900 + 800, + 900, + 1000, + 1100, + 1200, + 1300, + 1400, + 1500, + 1600, + 1700, + 1800, + 1900, + 2000, + 2100, + 2200, + 2300, + 2400, + 2500, + 2600, + 2700, + 2800, + 2900, + 3000, + 3100, + 3200, + 3300, + 3400, + 3500, + 3600, + 3700, + 3800, + 3900 ], "y": [ - 2.5300000000000002, - 7.61, - 12.66, - 17.76, - 22.85 + 2.005006419494748, + 4.022378381341696, + 6.063008587807417, + 8.07199478149414, + 15.027741901576519, + 18.02756767719984, + 21.205922681838274, + 24.060998111963272, + 27.207420067861676, + 30.045913998037577, + 33.184027718380094, + 29.911083541810513, + 39.21850915066898, + 42.042862959206104, + 45.27976457029581, + 48.03103506565094, + 108.42642900533974, + 36.39472732320428, + 57.152095437049866, + 42.38697048276663, + 63.30844033509493, + 132.97371263429523, + 81.73114294325933, + 116.95187920471653, + 73.20595596777275, + 150.9596981923096, + 155.436400459148, + 209.72602259367704, + 114.01065992517397, + 147.56739552505314, + 161.34091241657734, + 324.7810024325736, + 167.44374121632427, + 97.48291622428223, + 171.87959975609556, + 133.67409747699276, + 318.88608211046085, + 140.35703712748364, + 110.78012464055791 ] }, { - "line": { + "marker": { "color": "red" }, - "mode": "lines", + "mode": "markers", "name": "yappi", "type": "scatter", "x": [ 100, + 200, 300, + 400, 500, + 600, 700, - 900 + 800, + 900, + 1000, + 1100, + 1200, + 1300, + 1400, + 1500, + 1600, + 1700, + 1800, + 1900, + 2000, + 2100, + 2200, + 2300, + 2400, + 2500, + 2600, + 2700, + 2800, + 2900, + 3000, + 3100, + 3200, + 3300, + 3400, + 3500, + 3600, + 3700, + 3800, + 3900 ], "y": [ - 2.5606519999999997, - 7.633044, - 12.775767, - 17.922031, - 22.972393999999998 + 2.5950919999999997, + 5.616319, + 9.059268, + 12.332991999999999, + 15.301478, + 17.120825, + 24.201725, + 26.93514, + 30.613598999999997, + 35.975335, + 40.366104, + 45.955129, + 51.285728999999996, + 58.522748, + 66.292866, + 71.760232, + 92.410927, + 98.248446, + 116.13905299999999, + 131.324099, + 160.877873, + 183.45910999999998, + 186.28006499999998, + 212.972286, + 631.503736, + 259.338771, + 318.884748, + 314.797732, + 364.56521399999997, + 370.41099099999997, + 420.08628, + 432.739113, + 1028.895783, + 538.50839, + 914.678376, + 612.6363719999999, + 617.604426, + 719.446907, + 720.276751 ] }, { @@ -544,17 +741,85 @@ "type": "scatter", "x": [ 100, + 200, 300, + 400, 500, + 600, 700, - 900 + 800, + 900, + 1000, + 1100, + 1200, + 1300, + 1400, + 1500, + 1600, + 1700, + 1800, + 1900, + 2000, + 2100, + 2200, + 2300, + 2400, + 2500, + 2600, + 2700, + 2800, + 2900, + 3000, + 3100, + 3200, + 3300, + 3400, + 3500, + 3600, + 3700, + 3800, + 3900 ], "y": [ 2.5, + 5, 7.5, + 10, 12.5, + 15, 17.5, - 22.5 + 20, + 22.5, + 25, + 27.5, + 30, + 32.5, + 35, + 37.5, + 40, + 42.5, + 45, + 47.5, + 50, + 52.5, + 55, + 57.5, + 60, + 62.5, + 65, + 67.5, + 70, + 72.5, + 75, + 77.5, + 80, + 82.5, + 85, + 87.5, + 90, + 92.5, + 95, + 97.5 ] } ], @@ -1396,9 +1661,9 @@ } }, "text/html": [ - "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "iterations = list(range(1, 10, 1))\n", + "func_name = 'recurse'\n", + "\n", + "yres, ares, tres = compare_coro(recurse, func_name, iterations)\n", + "plot_comp(func_name, iterations, ares, yres)" + ] + }, + { + "cell_type": "markdown", + "id": "b5e49dad", + "metadata": {}, + "source": [ + "## Percentages" + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "id": "927af260", + "metadata": {}, + "outputs": [], + "source": [ + "tot = 3.0\n", + "\n", + "async def sleeper(decimal):\n", + " await asyncio.sleep(tot * decimal)\n", + "\n", + "async def split(decimal):\n", + " await asyncio.sleep(tot * decimal)\n", + " await sleeper(1.0 - decimal)" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "id": "5f0a2143", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "id": "6ea889f3", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Completed iteration 5.\n", + "Completed iteration 10.\n", + "Completed iteration 15.\n", + "Completed iteration 20.\n" + ] + }, + { + "data": { + "application/vnd.plotly.v1+json": { + "config": { + "plotlyServerURL": "https://plot.ly" + }, + "data": [ + { + "line": { + "color": "blue" + }, + "mode": "lines", + "name": "aergia", + "type": "scatter", + "x": [ + 0, + 0.05, + 0.1, + 0.15000000000000002, + 0.2, + 0.25, + 0.30000000000000004, + 0.35000000000000003, + 0.4, + 0.45, + 0.5, + 0.55, + 0.6000000000000001, + 0.65, + 0.7000000000000001, + 0.75, + 0.8, + 0.8500000000000001, + 0.9, + 0.9500000000000001, + 1 + ], + "y": [ + 0, + 0.15009622182697058, + 0.30011437414214015, + 0.45024808775633574, + 0.6002707849256694, + 0.7502208026126027, + 0.9001351818442345, + 1.0502264993265271, + 1.2002556379884481, + 1.3501644786447287, + 1.500193199608475, + 1.6501498259603977, + 1.8002629317343235, + 1.9501247801817954, + 2.1001115990802646, + 2.2501964289695024, + 2.4001767858862877, + 2.550205725710839, + 2.7002862547524273, + 2.8501306800171733, + 3.0004976578056812 + ] + }, + { + "line": { + "color": "red" + }, + "mode": "lines", + "name": "yappi", + "type": "scatter", + "x": [ + 0, + 0.05, + 0.1, + 0.15000000000000002, + 0.2, + 0.25, + 0.30000000000000004, + 0.35000000000000003, + 0.4, + 0.45, + 0.5, + 0.55, + 0.6000000000000001, + 0.65, + 0.7000000000000001, + 0.75, + 0.8, + 0.8500000000000001, + 0.9, + 0.9500000000000001, + 1 + ], + "y": [ + 3.2999999999999996e-05, + 0.150732, + 0.30107999999999996, + 0.451211, + 0.601286, + 0.751298, + 0.90208, + 1.0515349999999999, + 1.201754, + 1.351721, + 1.502395, + 1.65337, + 1.802042, + 1.9524549999999998, + 2.101533, + 2.252353, + 2.4030609999999997, + 2.552413, + 2.7036089999999997, + 2.8514489999999997, + 3.002735 + ] + }, + { + "line": { + "color": "green" + }, + "mode": "lines", + "name": "ideal", + "type": "scatter", + "x": [ + 0, + 0.05, + 0.1, + 0.15000000000000002, + 0.2, + 0.25, + 0.30000000000000004, + 0.35000000000000003, + 0.4, + 0.45, + 0.5, + 0.55, + 0.6000000000000001, + 0.65, + 0.7000000000000001, + 0.75, + 0.8, + 0.8500000000000001, + 0.9, + 0.9500000000000001, + 1 + ], + "y": [ + 0.0007268860936164856, + 0.15181733295321465, + 0.30111302714794874, + 0.4524425766430795, + 0.6026221080683172, + 0.7527396096847951, + 0.9020893340930343, + 1.052568478975445, + 1.2025728281587362, + 1.3535371590405703, + 1.503610004670918, + 1.6543716248124838, + 1.8023136099800467, + 1.9535730369389057, + 2.1034863088279963, + 2.2541096741333604, + 2.4044889067299664, + 2.555527030956, + 2.7036496619693935, + 2.8524399916641414, + 3.0050483238883317 + ] + } + ], + "layout": { + "legend": { + "title": { + "text": "Legend" + } + }, + "template": { + "data": { + "bar": [ + { + "error_x": { + "color": "#2a3f5f" + }, + "error_y": { + "color": "#2a3f5f" + }, + "marker": { + "line": { + "color": "#E5ECF6", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "bar" + } + ], + "barpolar": [ + { + "marker": { + "line": { + "color": "#E5ECF6", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "barpolar" + } + ], + "carpet": [ + { + "aaxis": { + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" + }, + "baxis": { + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" + }, + "type": "carpet" + } + ], + "choropleth": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "choropleth" + } + ], + "contour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "contour" + } + ], + "contourcarpet": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "contourcarpet" + } + ], + "heatmap": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmap" + } + ], + "heatmapgl": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmapgl" + } + ], + "histogram": [ + { + "marker": { + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "histogram" + } + ], + "histogram2d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2d" + } + ], + "histogram2dcontour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2dcontour" + } + ], + "mesh3d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "mesh3d" + } + ], + "parcoords": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "parcoords" + } + ], + "pie": [ + { + "automargin": true, + "type": "pie" + } + ], + "scatter": [ + { + "fillpattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + }, + "type": "scatter" + } + ], + "scatter3d": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatter3d" + } + ], + "scattercarpet": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattercarpet" + } + ], + "scattergeo": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergeo" + } + ], + "scattergl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergl" + } + ], + "scattermapbox": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattermapbox" + } + ], + "scatterpolar": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolar" + } + ], + "scatterpolargl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolargl" + } + ], + "scatterternary": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterternary" + } + ], + "surface": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "surface" + } + ], + "table": [ + { + "cells": { + "fill": { + "color": "#EBF0F8" + }, + "line": { + "color": "white" + } + }, + "header": { + "fill": { + "color": "#C8D4E3" + }, + "line": { + "color": "white" + } + }, + "type": "table" + } + ] + }, + "layout": { + "annotationdefaults": { + "arrowcolor": "#2a3f5f", + "arrowhead": 0, + "arrowwidth": 1 + }, + "autotypenumbers": "strict", + "coloraxis": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "colorscale": { + "diverging": [ + [ + 0, + "#8e0152" + ], + [ + 0.1, + "#c51b7d" + ], + [ + 0.2, + "#de77ae" + ], + [ + 0.3, + "#f1b6da" + ], + [ + 0.4, + "#fde0ef" + ], + [ + 0.5, + "#f7f7f7" + ], + [ + 0.6, + "#e6f5d0" + ], + [ + 0.7, + "#b8e186" + ], + [ + 0.8, + "#7fbc41" + ], + [ + 0.9, + "#4d9221" + ], + [ + 1, + "#276419" + ] + ], + "sequential": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "sequentialminus": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ] + }, + "colorway": [ + "#636efa", + "#EF553B", + "#00cc96", + "#ab63fa", + "#FFA15A", + "#19d3f3", + "#FF6692", + "#B6E880", + "#FF97FF", + "#FECB52" + ], + "font": { + "color": "#2a3f5f" + }, + "geo": { + "bgcolor": "white", + "lakecolor": "white", + "landcolor": "#E5ECF6", + "showlakes": true, + "showland": true, + "subunitcolor": "white" + }, + "hoverlabel": { + "align": "left" + }, + "hovermode": "closest", + "mapbox": { + "style": "light" + }, + "paper_bgcolor": "white", + "plot_bgcolor": "#E5ECF6", + "polar": { + "angularaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "bgcolor": "#E5ECF6", + "radialaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + } + }, + "scene": { + "xaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + }, + "yaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + }, + "zaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + } + }, + "shapedefaults": { + "line": { + "color": "#2a3f5f" + } + }, + "ternary": { + "aaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "baxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "bgcolor": "#E5ECF6", + "caxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + } + }, + "title": { + "x": 0.05 + }, + "xaxis": { + "automargin": true, + "gridcolor": "white", + "linecolor": "white", + "ticks": "", + "title": { + "standoff": 15 + }, + "zerolinecolor": "white", + "zerolinewidth": 2 + }, + "yaxis": { + "automargin": true, + "gridcolor": "white", + "linecolor": "white", + "ticks": "", + "title": { + "standoff": 15 + }, + "zerolinecolor": "white", + "zerolinewidth": 2 + } + } + }, + "title": { + "text": "Reported Seconds for Coroutine sleeper" + }, + "xaxis": { + "title": { + "text": "tasks run simultaniously" + } + }, + "yaxis": { + "title": { + "text": "reported seconds" + } + } + } + }, + "text/html": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "iterations = list(np.arange(0, 1.05, 0.05))\n", + "func_name = 'sleeper'\n", + "\n", + "yres, ares, tres = compare_coro(sleeper, func_name, iterations)\n", + "plot_comp(func_name, iterations, ares, yres, tres)" + ] + }, + { + "cell_type": "markdown", + "id": "f8984f04", + "metadata": {}, + "source": [ + "## Many Suspends" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "id": "eec6611f", + "metadata": {}, + "outputs": [], + "source": [ + "incre = 0.01\n", + "async def loop(total_time):\n", + " elapsed = 0\n", + " while (elapsed < total_time):\n", + " await asyncio.sleep(incre)\n", + " elapsed += incre" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "id": "a7e659ec", + "metadata": {}, + "outputs": [], + "source": [ + "incre = 0.01\n", + "async def loop_sync(total_time):\n", + " elapsed = 0\n", + " while (elapsed < total_time):\n", + " time.sleep(incre)\n", + " elapsed += incre" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "118d13ea", + "metadata": {}, + "outputs": [], + "source": [ + "total_time = 0.5\n", + "async def loop(iterations):\n", + " elapsed = 0\n", + " sleep_time = total_time / iterations\n", + " while (elapsed < total_time):\n", + " await asyncio.sleep(sleep_time)\n", + " elapsed += sleep_time" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "id": "a34751ac", + "metadata": {}, + "outputs": [], + "source": [ + "total_time = 3.0\n", + "async def loop(iterations):\n", + " t0 = time.perf_counter()\n", + " elapsed = 0\n", + " sleep_time = total_time / iterations\n", + " while (elapsed < total_time):\n", + " await asyncio.sleep(sleep_time)\n", + " elapsed = time.perf_counter() - t0" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "id": "f71f632f", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FILE FUNC SEC \n", + "kernel_11465/510785827.py:1 run_coro 1.3483 \n", + "kernel_11465/510785827.py:2 1.3467 \n", + "kernel_11465/369181571.py:2 loop 1.3281 \n" + ] + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "run_with_yappi(loop(300), True)" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "id": "38fab937", + "metadata": {}, + "outputs": [], + "source": [ + "from plotly.subplots import make_subplots" + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "id": "b4b6c880", + "metadata": {}, + "outputs": [], + "source": [ + "def plot_comp_suspends(func_name,\n", + " iterations,\n", + " aergia_async,\n", + " yappi_async,\n", + " aergia_sleep,\n", + " yappi_sleep,\n", + " ideal_async=None,\n", + " ideal_sleep=None,\n", + " color1='blue',\n", + " color2='red',\n", + " color3='green',\n", + " color4='purple',\n", + " color5='yellow',\n", + " color6='orange'):\n", + " fig = go.Figure()\n", + "\n", + " fig.add_trace(go.Scatter(x=iterations, y=aergia_async, mode='markers', name='aergia (async)', marker=dict(color=color1)))\n", + " fig.add_trace(go.Scatter(x=iterations, y=yappi_async, mode='markers', name='yappi (async)', marker=dict(color=color2)))\n", + " fig.add_trace(go.Scatter(x=iterations, y=aergia_sleep, mode='markers', name='aergia (sync)', marker=dict(color=color4)))\n", + " fig.add_trace(go.Scatter(x=iterations, y=yappi_sleep, mode='markers', name='yappi (sync)', marker=dict(color=color5)))\n", + " if ideal_async:\n", + " fig.add_trace(go.Scatter(x=iterations, y=ideal_async, mode='lines', name='ideal (async)', line=dict(color=color3)))\n", + " if ideal_sleep:\n", + " fig.add_trace(go.Scatter(x=iterations, y=ideal_sleep, mode='lines', name='ideal (sync)', line=dict(color=color6)))\n", + "\n", + "\n", + " fig.update_layout(\n", + " title=f'Reported Seconds for Coroutine {func_name}',\n", + " xaxis_title='number of suspends',\n", + " yaxis_title='reported seconds',\n", + " legend_title='Legend',\n", + " )\n", + " \n", + " fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": 84, + "id": "b677bd41", + "metadata": {}, + "outputs": [], + "source": [ + "def plot_comp_suspends(func_name,\n", + " iterations,\n", + " aergia_async,\n", + " yappi_async,\n", + " aergia_sleep,\n", + " yappi_sleep,\n", + " ideal_async=None,\n", + " ideal_sleep=None,\n", + " color1='blue',\n", + " color2='red',\n", + " color3='green'):\n", + "\n", + " fig = make_subplots(rows=1, cols=2, subplot_titles=('Asynchronous', 'Synchronous'))\n", + "\n", + " # async\n", + " fig.add_trace(go.Scatter(x=iterations, y=aergia_async, mode='markers', name='aergia', marker=dict(color=color1)), row=1, col=1)\n", + " fig.add_trace(go.Scatter(x=iterations, y=yappi_async, mode='markers', name='yappi', marker=dict(color=color2)), row=1, col=1)\n", + " if ideal_async:\n", + " fig.add_trace(go.Scatter(x=iterations, y=ideal_async, mode='lines', name='ideal', line=dict(color=color3)), row=1, col=1)\n", + " \n", + " # sync\n", + " fig.add_trace(go.Scatter(x=iterations, y=aergia_sleep, mode='markers', marker=dict(color=color1)), row=1, col=2)\n", + " fig.add_trace(go.Scatter(x=iterations, y=yappi_sleep, mode='markers', marker=dict(color=color2)), row=1, col=2)\n", + " if ideal_sleep:\n", + " fig.add_trace(go.Scatter(x=iterations, y=ideal_sleep, mode='lines', line=dict(color=color3)), row=1, col=2)\n", + "\n", + "\n", + " fig.update_layout(\n", + " title=f'Reported Seconds for Coroutine {func_name}',\n", + " xaxis_title='supplied seconds',\n", + " yaxis_title='reported seconds',\n", + " legend_title='Legend',\n", + " )\n", + " \n", + " fig.update_xaxes(title_text='supplied seconds', row=1, col=2)\n", + "\n", + " fig.for_each_trace(lambda trace: trace.update(showlegend=False) if trace.name not in ['aergia', 'yappi', 'ideal'] else trace.update(showlegend=True))\n", + "\n", + " fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "id": "5fa03e58", + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Completed iteration 5.\n", + "Completed iteration 10.\n", + "Completed iteration 15.\n", + "Completed iteration 20.\n", + "Completed iteration 5.\n", + "Completed iteration 10.\n", + "Completed iteration 15.\n", + "Completed iteration 20.\n" + ] + }, + { + "data": { + "application/vnd.plotly.v1+json": { + "config": { + "plotlyServerURL": "https://plot.ly" + }, + "data": [ + { + "marker": { + "color": "blue" + }, + "mode": "markers", + "name": "aergia (async)", + "type": "scatter", + "x": [ + 1, + 1.05, + 1.1, + 1.1500000000000001, + 1.2000000000000002, + 1.2500000000000002, + 1.3000000000000003, + 1.3500000000000003, + 1.4000000000000004, + 1.4500000000000004, + 1.5000000000000004, + 1.5500000000000005, + 1.6000000000000005, + 1.6500000000000006, + 1.7000000000000006, + 1.7500000000000007, + 1.8000000000000007, + 1.8500000000000008, + 1.9000000000000008, + 1.9500000000000008, + 2.000000000000001 + ], + "y": [ + 1.0300953341647983, + 1.0802009324543178, + 1.1401102892123163, + 1.2001721197739244, + 1.2402368150651455, + 1.300108595751226, + 1.3402596428059042, + 1.4102244419045746, + 1.4502821927890182, + 1.5102193402126431, + 1.550266901962459, + 1.6102515012025833, + 1.6602449710480869, + 1.7102482449263334, + 1.7601053649559617, + 1.8102183281444013, + 1.870239730924368, + 1.920077980030328, + 1.9701147247105837, + 2.020098625216633, + 2.070262962952256 + ] + }, + { + "marker": { + "color": "red" + }, + "mode": "markers", + "name": "yappi (async)", + "type": "scatter", + "x": [ + 1, + 1.05, + 1.1, + 1.1500000000000001, + 1.2000000000000002, + 1.2500000000000002, + 1.3000000000000003, + 1.3500000000000003, + 1.4000000000000004, + 1.4500000000000004, + 1.5000000000000004, + 1.5500000000000005, + 1.6000000000000005, + 1.6500000000000006, + 1.7000000000000006, + 1.7500000000000007, + 1.8000000000000007, + 1.8500000000000008, + 1.9000000000000008, + 1.9500000000000008, + 2.000000000000001 + ], + "y": [ + 1.0531409999999999, + 1.105372, + 1.169269, + 1.222488, + 1.272761, + 1.321475, + 1.369121, + 1.437926, + 1.488507, + 1.516986, + 1.579901, + 1.63968, + 1.690458, + 1.74538, + 1.7913219999999999, + 1.852539, + 1.900307, + 1.954483, + 2.0048749999999997, + 2.077261, + 2.115004 + ] + }, + { + "marker": { + "color": "purple" + }, + "mode": "markers", + "name": "aergia (sync)", + "type": "scatter", + "x": [ + 1, + 1.05, + 1.1, + 1.1500000000000001, + 1.2000000000000002, + 1.2500000000000002, + 1.3000000000000003, + 1.3500000000000003, + 1.4000000000000004, + 1.4500000000000004, + 1.5000000000000004, + 1.5500000000000005, + 1.6000000000000005, + 1.6500000000000006, + 1.7000000000000006, + 1.7500000000000007, + 1.8000000000000007, + 1.8500000000000008, + 1.9000000000000008, + 1.9500000000000008, + 2.000000000000001 + ], + "y": [ + 1.020435520913452, + 1.0601372215896845, + 1.120198197197169, + 1.1701389467343688, + 1.2204098380170763, + 1.2702048257924616, + 1.3202419900335371, + 1.3703030860051513, + 1.4302367977797985, + 1.4803100978024304, + 1.5301465331576765, + 1.5803418941795826, + 1.6401383159682155, + 1.680330959148705, + 1.740354185923934, + 1.7801085580140352, + 1.8402847493998706, + 1.8802420520223677, + 1.9401059318333864, + 1.9902589921839535, + 2.0303331739269197 + ] + }, + { + "marker": { + "color": "yellow" + }, + "mode": "markers", + "name": "yappi (sync)", + "type": "scatter", + "x": [ + 1, + 1.05, + 1.1, + 1.1500000000000001, + 1.2000000000000002, + 1.2500000000000002, + 1.3000000000000003, + 1.3500000000000003, + 1.4000000000000004, + 1.4500000000000004, + 1.5000000000000004, + 1.5500000000000005, + 1.6000000000000005, + 1.6500000000000006, + 1.7000000000000006, + 1.7500000000000007, + 1.8000000000000007, + 1.8500000000000008, + 1.9000000000000008, + 1.9500000000000008, + 2.000000000000001 + ], + "y": [ + 1.027583, + 1.076679, + 1.128027, + 1.1794639999999998, + 1.2273049999999999, + 1.278257, + 1.33124, + 1.381762, + 1.432516, + 1.4863279999999999, + 1.5378459999999998, + 1.58412, + 1.6415819999999999, + 1.694651, + 1.74063, + 1.7917779999999999, + 1.841894, + 1.8937629999999999, + 1.944521, + 1.991728, + 2.0460819999999997 + ] + }, + { + "line": { + "color": "green" + }, + "mode": "lines", + "name": "ideal (async)", + "type": "scatter", + "x": [ + 1, + 1.05, + 1.1, + 1.1500000000000001, + 1.2000000000000002, + 1.2500000000000002, + 1.3000000000000003, + 1.3500000000000003, + 1.4000000000000004, + 1.4500000000000004, + 1.5000000000000004, + 1.5500000000000005, + 1.6000000000000005, + 1.6500000000000006, + 1.7000000000000006, + 1.7500000000000007, + 1.8000000000000007, + 1.8500000000000008, + 1.9000000000000008, + 1.9500000000000008, + 2.000000000000001 + ], + "y": [ + 1.0381560889072716, + 1.0935737527906895, + 1.1415139031596482, + 1.1995012792758644, + 1.2570461612194777, + 1.3015670850872993, + 1.3514276333153248, + 1.4129177499562502, + 1.461818407755345, + 1.5046086576767266, + 1.568426975980401, + 1.613852680195123, + 1.6711010057479143, + 1.7146760928444564, + 1.7666827039793134, + 1.8171685934066772, + 1.8699824321083724, + 1.9171160878613591, + 1.9652346018701792, + 2.026691841892898, + 2.085880281869322 + ] + }, + { + "line": { + "color": "orange" + }, + "mode": "lines", + "name": "ideal (sync)", + "type": "scatter", + "x": [ + 1, + 1.05, + 1.1, + 1.1500000000000001, + 1.2000000000000002, + 1.2500000000000002, + 1.3000000000000003, + 1.3500000000000003, + 1.4000000000000004, + 1.4500000000000004, + 1.5000000000000004, + 1.5500000000000005, + 1.6000000000000005, + 1.6500000000000006, + 1.7000000000000006, + 1.7500000000000007, + 1.8000000000000007, + 1.8500000000000008, + 1.9000000000000008, + 1.9500000000000008, + 2.000000000000001 + ], + "y": [ + 1.0254312087781727, + 1.0748692457564175, + 1.1298753069713712, + 1.1770338122732937, + 1.2249595350585878, + 1.2809668709523976, + 1.332599949091673, + 1.3825336652807891, + 1.4344221390783787, + 1.4828009270131588, + 1.5348775018937886, + 1.581768977921456, + 1.6351896738633513, + 1.689969011116773, + 1.7393375630490482, + 1.7919335379265249, + 1.8398224981501698, + 1.888107960112393, + 1.9374144719913602, + 1.9958957210183144, + 2.040139697957784 + ] + } + ], + "layout": { + "legend": { + "title": { + "text": "Legend" + } + }, + "template": { + "data": { + "bar": [ + { + "error_x": { + "color": "#2a3f5f" + }, + "error_y": { + "color": "#2a3f5f" + }, + "marker": { + "line": { + "color": "#E5ECF6", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "bar" + } + ], + "barpolar": [ + { + "marker": { + "line": { + "color": "#E5ECF6", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "barpolar" + } + ], + "carpet": [ + { + "aaxis": { + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" + }, + "baxis": { + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" + }, + "type": "carpet" + } + ], + "choropleth": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "choropleth" + } + ], + "contour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "contour" + } + ], + "contourcarpet": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "contourcarpet" + } + ], + "heatmap": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmap" + } + ], + "heatmapgl": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmapgl" + } + ], + "histogram": [ + { + "marker": { + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "histogram" + } + ], + "histogram2d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2d" + } + ], + "histogram2dcontour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2dcontour" + } + ], + "mesh3d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "mesh3d" + } + ], + "parcoords": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "parcoords" + } + ], + "pie": [ + { + "automargin": true, + "type": "pie" + } + ], + "scatter": [ + { + "fillpattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + }, + "type": "scatter" + } + ], + "scatter3d": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatter3d" + } + ], + "scattercarpet": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattercarpet" + } + ], + "scattergeo": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergeo" + } + ], + "scattergl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergl" + } + ], + "scattermapbox": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattermapbox" + } + ], + "scatterpolar": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolar" + } + ], + "scatterpolargl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolargl" + } + ], + "scatterternary": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterternary" + } + ], + "surface": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "surface" + } + ], + "table": [ + { + "cells": { + "fill": { + "color": "#EBF0F8" + }, + "line": { + "color": "white" + } + }, + "header": { + "fill": { + "color": "#C8D4E3" + }, + "line": { + "color": "white" + } + }, + "type": "table" + } + ] + }, + "layout": { + "annotationdefaults": { + "arrowcolor": "#2a3f5f", + "arrowhead": 0, + "arrowwidth": 1 + }, + "autotypenumbers": "strict", + "coloraxis": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "colorscale": { + "diverging": [ + [ + 0, + "#8e0152" + ], + [ + 0.1, + "#c51b7d" + ], + [ + 0.2, + "#de77ae" + ], + [ + 0.3, + "#f1b6da" + ], + [ + 0.4, + "#fde0ef" + ], + [ + 0.5, + "#f7f7f7" + ], + [ + 0.6, + "#e6f5d0" + ], + [ + 0.7, + "#b8e186" + ], + [ + 0.8, + "#7fbc41" + ], + [ + 0.9, + "#4d9221" + ], + [ + 1, + "#276419" + ] + ], + "sequential": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "sequentialminus": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ] + }, + "colorway": [ + "#636efa", + "#EF553B", + "#00cc96", + "#ab63fa", + "#FFA15A", + "#19d3f3", + "#FF6692", + "#B6E880", + "#FF97FF", + "#FECB52" + ], + "font": { + "color": "#2a3f5f" + }, + "geo": { + "bgcolor": "white", + "lakecolor": "white", + "landcolor": "#E5ECF6", + "showlakes": true, + "showland": true, + "subunitcolor": "white" + }, + "hoverlabel": { + "align": "left" + }, + "hovermode": "closest", + "mapbox": { + "style": "light" + }, + "paper_bgcolor": "white", + "plot_bgcolor": "#E5ECF6", + "polar": { + "angularaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "bgcolor": "#E5ECF6", + "radialaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + } + }, + "scene": { + "xaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + }, + "yaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + }, + "zaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + } + }, + "shapedefaults": { + "line": { + "color": "#2a3f5f" + } + }, + "ternary": { + "aaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "baxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "bgcolor": "#E5ECF6", + "caxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + } + }, + "title": { + "x": 0.05 + }, + "xaxis": { + "automargin": true, + "gridcolor": "white", + "linecolor": "white", + "ticks": "", + "title": { + "standoff": 15 + }, + "zerolinecolor": "white", + "zerolinewidth": 2 + }, + "yaxis": { + "automargin": true, + "gridcolor": "white", + "linecolor": "white", + "ticks": "", + "title": { + "standoff": 15 + }, + "zerolinecolor": "white", + "zerolinewidth": 2 + } + } + }, + "title": { + "text": "Reported Seconds for Coroutine loop" + }, + "xaxis": { + "title": { + "text": "number of suspends" + } + }, + "yaxis": { + "title": { + "text": "reported seconds" + } + } + } + }, + "text/html": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "iterations = list(np.arange(1, 2.05, 0.05))\n", + "func_name = 'loop'\n", + "\n", + "yres, ares, tres = compare_coro(loop, func_name, iterations)\n", + "yres_s, ares_s, tres_s = compare_coro(loop_sync, 'loop_sync', iterations)\n", + "plot_comp_suspends(func_name, iterations, ares, yres, ares_s, yres_s, tres, tres_s)" + ] + }, + { + "cell_type": "code", + "execution_count": 85, + "id": "9414e710", + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.plotly.v1+json": { + "config": { + "plotlyServerURL": "https://plot.ly" + }, + "data": [ + { + "marker": { + "color": "blue" + }, + "mode": "markers", + "name": "aergia", + "showlegend": true, + "type": "scatter", + "x": [ + 1, + 1.05, + 1.1, + 1.1500000000000001, + 1.2000000000000002, + 1.2500000000000002, + 1.3000000000000003, + 1.3500000000000003, + 1.4000000000000004, + 1.4500000000000004, + 1.5000000000000004, + 1.5500000000000005, + 1.6000000000000005, + 1.6500000000000006, + 1.7000000000000006, + 1.7500000000000007, + 1.8000000000000007, + 1.8500000000000008, + 1.9000000000000008, + 1.9500000000000008, + 2.000000000000001 + ], + "xaxis": "x", + "y": [ + 1.0300953341647983, + 1.0802009324543178, + 1.1401102892123163, + 1.2001721197739244, + 1.2402368150651455, + 1.300108595751226, + 1.3402596428059042, + 1.4102244419045746, + 1.4502821927890182, + 1.5102193402126431, + 1.550266901962459, + 1.6102515012025833, + 1.6602449710480869, + 1.7102482449263334, + 1.7601053649559617, + 1.8102183281444013, + 1.870239730924368, + 1.920077980030328, + 1.9701147247105837, + 2.020098625216633, + 2.070262962952256 + ], + "yaxis": "y" + }, + { + "marker": { + "color": "red" + }, + "mode": "markers", + "name": "yappi", + "showlegend": true, + "type": "scatter", + "x": [ + 1, + 1.05, + 1.1, + 1.1500000000000001, + 1.2000000000000002, + 1.2500000000000002, + 1.3000000000000003, + 1.3500000000000003, + 1.4000000000000004, + 1.4500000000000004, + 1.5000000000000004, + 1.5500000000000005, + 1.6000000000000005, + 1.6500000000000006, + 1.7000000000000006, + 1.7500000000000007, + 1.8000000000000007, + 1.8500000000000008, + 1.9000000000000008, + 1.9500000000000008, + 2.000000000000001 + ], + "xaxis": "x", + "y": [ + 1.0531409999999999, + 1.105372, + 1.169269, + 1.222488, + 1.272761, + 1.321475, + 1.369121, + 1.437926, + 1.488507, + 1.516986, + 1.579901, + 1.63968, + 1.690458, + 1.74538, + 1.7913219999999999, + 1.852539, + 1.900307, + 1.954483, + 2.0048749999999997, + 2.077261, + 2.115004 + ], + "yaxis": "y" + }, + { + "line": { + "color": "green" + }, + "mode": "lines", + "name": "ideal", + "showlegend": true, + "type": "scatter", + "x": [ + 1, + 1.05, + 1.1, + 1.1500000000000001, + 1.2000000000000002, + 1.2500000000000002, + 1.3000000000000003, + 1.3500000000000003, + 1.4000000000000004, + 1.4500000000000004, + 1.5000000000000004, + 1.5500000000000005, + 1.6000000000000005, + 1.6500000000000006, + 1.7000000000000006, + 1.7500000000000007, + 1.8000000000000007, + 1.8500000000000008, + 1.9000000000000008, + 1.9500000000000008, + 2.000000000000001 + ], + "xaxis": "x", + "y": [ + 1.0381560889072716, + 1.0935737527906895, + 1.1415139031596482, + 1.1995012792758644, + 1.2570461612194777, + 1.3015670850872993, + 1.3514276333153248, + 1.4129177499562502, + 1.461818407755345, + 1.5046086576767266, + 1.568426975980401, + 1.613852680195123, + 1.6711010057479143, + 1.7146760928444564, + 1.7666827039793134, + 1.8171685934066772, + 1.8699824321083724, + 1.9171160878613591, + 1.9652346018701792, + 2.026691841892898, + 2.085880281869322 + ], + "yaxis": "y" + }, + { + "marker": { + "color": "blue" + }, + "mode": "markers", + "showlegend": false, + "type": "scatter", + "x": [ + 1, + 1.05, + 1.1, + 1.1500000000000001, + 1.2000000000000002, + 1.2500000000000002, + 1.3000000000000003, + 1.3500000000000003, + 1.4000000000000004, + 1.4500000000000004, + 1.5000000000000004, + 1.5500000000000005, + 1.6000000000000005, + 1.6500000000000006, + 1.7000000000000006, + 1.7500000000000007, + 1.8000000000000007, + 1.8500000000000008, + 1.9000000000000008, + 1.9500000000000008, + 2.000000000000001 + ], + "xaxis": "x2", + "y": [ + 1.020435520913452, + 1.0601372215896845, + 1.120198197197169, + 1.1701389467343688, + 1.2204098380170763, + 1.2702048257924616, + 1.3202419900335371, + 1.3703030860051513, + 1.4302367977797985, + 1.4803100978024304, + 1.5301465331576765, + 1.5803418941795826, + 1.6401383159682155, + 1.680330959148705, + 1.740354185923934, + 1.7801085580140352, + 1.8402847493998706, + 1.8802420520223677, + 1.9401059318333864, + 1.9902589921839535, + 2.0303331739269197 + ], + "yaxis": "y2" + }, + { + "marker": { + "color": "red" + }, + "mode": "markers", + "showlegend": false, + "type": "scatter", + "x": [ + 1, + 1.05, + 1.1, + 1.1500000000000001, + 1.2000000000000002, + 1.2500000000000002, + 1.3000000000000003, + 1.3500000000000003, + 1.4000000000000004, + 1.4500000000000004, + 1.5000000000000004, + 1.5500000000000005, + 1.6000000000000005, + 1.6500000000000006, + 1.7000000000000006, + 1.7500000000000007, + 1.8000000000000007, + 1.8500000000000008, + 1.9000000000000008, + 1.9500000000000008, + 2.000000000000001 + ], + "xaxis": "x2", + "y": [ + 1.027583, + 1.076679, + 1.128027, + 1.1794639999999998, + 1.2273049999999999, + 1.278257, + 1.33124, + 1.381762, + 1.432516, + 1.4863279999999999, + 1.5378459999999998, + 1.58412, + 1.6415819999999999, + 1.694651, + 1.74063, + 1.7917779999999999, + 1.841894, + 1.8937629999999999, + 1.944521, + 1.991728, + 2.0460819999999997 + ], + "yaxis": "y2" + }, + { + "line": { + "color": "green" + }, + "mode": "lines", + "showlegend": false, + "type": "scatter", + "x": [ + 1, + 1.05, + 1.1, + 1.1500000000000001, + 1.2000000000000002, + 1.2500000000000002, + 1.3000000000000003, + 1.3500000000000003, + 1.4000000000000004, + 1.4500000000000004, + 1.5000000000000004, + 1.5500000000000005, + 1.6000000000000005, + 1.6500000000000006, + 1.7000000000000006, + 1.7500000000000007, + 1.8000000000000007, + 1.8500000000000008, + 1.9000000000000008, + 1.9500000000000008, + 2.000000000000001 + ], + "xaxis": "x2", + "y": [ + 1.0254312087781727, + 1.0748692457564175, + 1.1298753069713712, + 1.1770338122732937, + 1.2249595350585878, + 1.2809668709523976, + 1.332599949091673, + 1.3825336652807891, + 1.4344221390783787, + 1.4828009270131588, + 1.5348775018937886, + 1.581768977921456, + 1.6351896738633513, + 1.689969011116773, + 1.7393375630490482, + 1.7919335379265249, + 1.8398224981501698, + 1.888107960112393, + 1.9374144719913602, + 1.9958957210183144, + 2.040139697957784 + ], + "yaxis": "y2" + } + ], + "layout": { + "annotations": [ + { + "font": { + "size": 16 + }, + "showarrow": false, + "text": "Asynchronous", + "x": 0.225, + "xanchor": "center", + "xref": "paper", + "y": 1, + "yanchor": "bottom", + "yref": "paper" + }, + { + "font": { + "size": 16 + }, + "showarrow": false, + "text": "Synchronous", + "x": 0.775, + "xanchor": "center", + "xref": "paper", + "y": 1, + "yanchor": "bottom", + "yref": "paper" + } + ], + "legend": { + "title": { + "text": "Legend" + } + }, + "template": { + "data": { + "bar": [ + { + "error_x": { + "color": "#2a3f5f" + }, + "error_y": { + "color": "#2a3f5f" + }, + "marker": { + "line": { + "color": "#E5ECF6", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "bar" + } + ], + "barpolar": [ + { + "marker": { + "line": { + "color": "#E5ECF6", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "barpolar" + } + ], + "carpet": [ + { + "aaxis": { + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" + }, + "baxis": { + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" + }, + "type": "carpet" + } + ], + "choropleth": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "choropleth" + } + ], + "contour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "contour" + } + ], + "contourcarpet": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "contourcarpet" + } + ], + "heatmap": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmap" + } + ], + "heatmapgl": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmapgl" + } + ], + "histogram": [ + { + "marker": { + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "histogram" + } + ], + "histogram2d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2d" + } + ], + "histogram2dcontour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2dcontour" + } + ], + "mesh3d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "mesh3d" + } + ], + "parcoords": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "parcoords" + } + ], + "pie": [ + { + "automargin": true, + "type": "pie" + } + ], + "scatter": [ + { + "fillpattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + }, + "type": "scatter" + } + ], + "scatter3d": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatter3d" + } + ], + "scattercarpet": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattercarpet" + } + ], + "scattergeo": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergeo" + } + ], + "scattergl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergl" + } + ], + "scattermapbox": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattermapbox" + } + ], + "scatterpolar": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolar" + } + ], + "scatterpolargl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolargl" + } + ], + "scatterternary": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterternary" + } + ], + "surface": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "surface" + } + ], + "table": [ + { + "cells": { + "fill": { + "color": "#EBF0F8" + }, + "line": { + "color": "white" + } + }, + "header": { + "fill": { + "color": "#C8D4E3" + }, + "line": { + "color": "white" + } + }, + "type": "table" + } + ] + }, + "layout": { + "annotationdefaults": { + "arrowcolor": "#2a3f5f", + "arrowhead": 0, + "arrowwidth": 1 + }, + "autotypenumbers": "strict", + "coloraxis": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "colorscale": { + "diverging": [ + [ + 0, + "#8e0152" + ], + [ + 0.1, + "#c51b7d" + ], + [ + 0.2, + "#de77ae" + ], + [ + 0.3, + "#f1b6da" + ], + [ + 0.4, + "#fde0ef" + ], + [ + 0.5, + "#f7f7f7" + ], + [ + 0.6, + "#e6f5d0" + ], + [ + 0.7, + "#b8e186" + ], + [ + 0.8, + "#7fbc41" + ], + [ + 0.9, + "#4d9221" + ], + [ + 1, + "#276419" + ] + ], + "sequential": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "sequentialminus": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ] + }, + "colorway": [ + "#636efa", + "#EF553B", + "#00cc96", + "#ab63fa", + "#FFA15A", + "#19d3f3", + "#FF6692", + "#B6E880", + "#FF97FF", + "#FECB52" + ], + "font": { + "color": "#2a3f5f" + }, + "geo": { + "bgcolor": "white", + "lakecolor": "white", + "landcolor": "#E5ECF6", + "showlakes": true, + "showland": true, + "subunitcolor": "white" + }, + "hoverlabel": { + "align": "left" + }, + "hovermode": "closest", + "mapbox": { + "style": "light" + }, + "paper_bgcolor": "white", + "plot_bgcolor": "#E5ECF6", + "polar": { + "angularaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "bgcolor": "#E5ECF6", + "radialaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + } + }, + "scene": { + "xaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + }, + "yaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + }, + "zaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + } + }, + "shapedefaults": { + "line": { + "color": "#2a3f5f" + } + }, + "ternary": { + "aaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "baxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "bgcolor": "#E5ECF6", + "caxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + } + }, + "title": { + "x": 0.05 + }, + "xaxis": { + "automargin": true, + "gridcolor": "white", + "linecolor": "white", + "ticks": "", + "title": { + "standoff": 15 + }, + "zerolinecolor": "white", + "zerolinewidth": 2 + }, + "yaxis": { + "automargin": true, + "gridcolor": "white", + "linecolor": "white", + "ticks": "", + "title": { + "standoff": 15 + }, + "zerolinecolor": "white", + "zerolinewidth": 2 + } + } + }, + "title": { + "text": "Reported Seconds for Coroutine loop" + }, + "xaxis": { + "anchor": "y", + "domain": [ + 0, + 0.45 + ], + "title": { + "text": "supplied seconds" + } + }, + "xaxis2": { + "anchor": "y2", + "domain": [ + 0.55, + 1 + ], + "title": { + "text": "supplied seconds" + } + }, + "yaxis": { + "anchor": "x", + "domain": [ + 0, + 1 + ], + "title": { + "text": "reported seconds" + } + }, + "yaxis2": { + "anchor": "x2", + "domain": [ + 0, + 1 + ] + } + } + }, + "text/html": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "plot_comp_suspends(func_name, iterations, ares, yres, ares_s, yres_s, tres, tres_s)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f357c529", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/t/test_functionality.py b/t/test_functionality.py index f259a26..78fae66 100644 --- a/t/test_functionality.py +++ b/t/test_functionality.py @@ -313,3 +313,18 @@ class BasicUsage(utils.AergiaUnitTestCase): self.assert_similar_delay('c', yappi_samples, aergia_samples) self.assert_similar_delay('b', yappi_samples, aergia_samples) self.assert_similar_delay('a', yappi_samples, aergia_samples) + + def test_never_idle(self): + delay = 0.2 + + def c(): utils.burn_cpu(delay) + async def b(): c() + async def a(): await asyncio.gather(b()) + + self.Aergia.start() + asyncio.run(a()) + self.Aergia.stop() + + aergia_samples = self.Aergia.get_samples() + + self.assert_reasonable_delay('a', 0, aergia_samples) diff --git a/t/test_yappi_adaptations.py b/t/test_yappi_adaptations.py index 4da8926..ffaabd5 100644 --- a/t/test_yappi_adaptations.py +++ b/t/test_yappi_adaptations.py @@ -30,6 +30,7 @@ class YappiTests(utils.AergiaUnitTestCase): self.assert_reasonable_delay('a', delay * 4, aergia_samples) # TODO revisit, I think Aergia was agreeable when I checked this manually + # possible function bias # self.assert_similar_delay('a', yappi_samples, aergia_samples) def test_basic_multithread(self): diff --git a/t/utils.py b/t/utils.py index fd2a4d3..cee4258 100644 --- a/t/utils.py +++ b/t/utils.py @@ -23,8 +23,7 @@ class AergiaUnitTestCase(unittest.TestCase): def assert_reasonable_delay(self, func_name, time_expected, samples): '''Compares the results reported by Aergia for FUNC_NAME with time_expected.''' - samples_actual = self.aergia_extract_values_by_func(samples, func_name) - time_actual = self.aergia_expected_time(samples_actual) + time_actual = self.aergia_extract_values_by_func(samples, func_name) self.assert_roughly_equal(time_actual, time_expected) def assert_similar_delay(self, func_name, yappi_stats, aergia_samples): @@ -32,9 +31,8 @@ class AergiaUnitTestCase(unittest.TestCase): with yappi.''' time_yappi = self.yappi_extract_values_by_func(yappi_stats, func_name) - samples_aergia = self.aergia_extract_values_by_func( + time_aergia = self.aergia_extract_values_by_func( aergia_samples, func_name) - time_aergia = self.aergia_expected_time(samples_aergia) self.assert_roughly_equal(time_aergia, time_yappi) @@ -45,11 +43,6 @@ class AergiaUnitTestCase(unittest.TestCase): a = abs(v1 - v2) self.assertTrue(a <= .035, f'{v1} (actual) not roughly {v2} (expected)') - def aergia_expected_time(self, total_samples): - '''Given TOTAL_SAMPLES, returns the total time, using the - sampling interval.''' - return total_samples * self.interval - def aergia_extract_values_by_func(self, samples, func_name): '''Returns the total number of samples for function name, given an Aergia SAMPLES object.''' @@ -79,12 +72,12 @@ class AergiaUnitTestCase(unittest.TestCase): def burn_cpu(sec): - t0 = Aergia._gettime() + t0 = time.perf_counter() elapsed = 0 while (elapsed < sec): for _ in range(1000): pass - elapsed = Aergia._gettime() - t0 + elapsed = time.perf_counter() - t0 def burn_io(sec): -- cgit v1.2.3