rsloop 0.1.44__tar.gz → 0.1.46__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. {rsloop-0.1.44 → rsloop-0.1.46}/.github/workflows/wheels.yml +4 -3
  2. {rsloop-0.1.44 → rsloop-0.1.46}/Cargo.lock +18 -54
  3. {rsloop-0.1.44 → rsloop-0.1.46}/Cargo.toml +14 -6
  4. {rsloop-0.1.44 → rsloop-0.1.46}/PKG-INFO +22 -1
  5. {rsloop-0.1.44 → rsloop-0.1.46}/README.md +21 -0
  6. {rsloop-0.1.44/vendor/vibeio → rsloop-0.1.46}/build.rs +3 -0
  7. {rsloop-0.1.44 → rsloop-0.1.46}/pyproject.toml +1 -1
  8. rsloop-0.1.46/scripts/build-pgo-wheels.sh +200 -0
  9. {rsloop-0.1.44 → rsloop-0.1.46}/src/bindings/loop_api/connections.rs +4 -4
  10. {rsloop-0.1.44 → rsloop-0.1.46}/src/bindings/loop_api/methods.rs +2 -2
  11. {rsloop-0.1.44 → rsloop-0.1.46}/src/bindings/loop_api/servers.rs +1 -1
  12. {rsloop-0.1.44 → rsloop-0.1.46}/src/engine/callbacks.rs +2 -2
  13. {rsloop-0.1.44 → rsloop-0.1.46}/src/engine/dispatcher.rs +31 -30
  14. {rsloop-0.1.44 → rsloop-0.1.46}/src/engine/loop_core.rs +61 -23
  15. {rsloop-0.1.44 → rsloop-0.1.46}/src/lib.rs +3 -0
  16. {rsloop-0.1.44 → rsloop-0.1.46}/src/platform/fd/mod.rs +1 -1
  17. {rsloop-0.1.44 → rsloop-0.1.46}/src/platform/windows_vibeio.rs +8 -5
  18. {rsloop-0.1.44 → rsloop-0.1.46}/src/profiler.rs +22 -0
  19. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/process/core_events.rs +6 -6
  20. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/process/worker.rs +2 -2
  21. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/accept.rs +9 -9
  22. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/connect.rs +2 -2
  23. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/core_events.rs +7 -7
  24. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/core_protocol.rs +5 -5
  25. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/core_write.rs +5 -3
  26. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/py_transport.rs +1 -1
  27. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/reader.rs +3 -3
  28. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/reader_task.rs +19 -19
  29. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/server.rs +1 -1
  30. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/socket_transport.rs +3 -3
  31. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/tls_session.rs +1 -1
  32. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/tls_transport.rs +2 -2
  33. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/writer.rs +3 -3
  34. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/tls/material.rs +2 -2
  35. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/tls/mod.rs +2 -2
  36. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/builder.rs +8 -23
  37. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/driver/iocp.rs +11 -11
  38. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/driver/kqueue.rs +4 -4
  39. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/driver/mio.rs +7 -7
  40. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/driver/mock.rs +4 -4
  41. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/driver/mod.rs +21 -14
  42. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/driver/uring.rs +7 -7
  43. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/executor.rs +26 -37
  44. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/fd_inner.rs +1 -1
  45. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/fs/file.rs +18 -18
  46. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/fs/mod.rs +98 -96
  47. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/fs/open_options.rs +9 -9
  48. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/io/mod.rs +2 -2
  49. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/io/pipe.rs +3 -3
  50. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/io/splice.rs +1 -1
  51. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/io/stdio.rs +9 -7
  52. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/io/util.rs +25 -7
  53. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/lib.rs +11 -6
  54. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/net/tcp/listener.rs +8 -9
  55. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/net/tcp/mod.rs +4 -4
  56. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/net/tcp/stream.rs +5 -5
  57. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/net/udp.rs +14 -12
  58. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/net/unix/listener.rs +3 -3
  59. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/net/unix/mod.rs +5 -5
  60. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/net/unix/stream.rs +3 -3
  61. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/accept.rs +7 -7
  62. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/accept_unix.rs +4 -4
  63. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/connect.rs +12 -12
  64. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/fsync.rs +5 -5
  65. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/hard_link.rs +4 -4
  66. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/io_util.rs +2 -2
  67. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/mkdir.rs +4 -4
  68. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/mod.rs +4 -4
  69. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/open.rs +4 -4
  70. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/read.rs +9 -9
  71. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/readat.rs +8 -8
  72. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/readiness.rs +3 -3
  73. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/readv.rs +8 -8
  74. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/recv.rs +9 -9
  75. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/recvfrom.rs +11 -10
  76. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/rename.rs +4 -4
  77. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/send.rs +9 -9
  78. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/sendto.rs +9 -9
  79. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/splice.rs +6 -6
  80. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/statx.rs +4 -4
  81. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/symlink.rs +4 -4
  82. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/unlink.rs +4 -4
  83. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/waitpid.rs +5 -5
  84. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/write.rs +9 -9
  85. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/writeat.rs +8 -8
  86. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/op/writev.rs +10 -10
  87. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/process/mod.rs +16 -14
  88. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/process/reaper.rs +12 -9
  89. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/signal/mod.rs +2 -2
  90. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/signal/unix.rs +4 -4
  91. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/signal/windows.rs +4 -4
  92. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/task.rs +2 -2
  93. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/time/mod.rs +9 -9
  94. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/time/sleep.rs +2 -2
  95. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/util/async_wrap.rs +12 -9
  96. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/util/mod.rs +1 -1
  97. {rsloop-0.1.44 → rsloop-0.1.46}/uv.lock +1 -1
  98. rsloop-0.1.44/build.rs +0 -4
  99. rsloop-0.1.44/vendor/vibeio/.cargo-ok +0 -1
  100. rsloop-0.1.44/vendor/vibeio/Cargo.lock +0 -352
  101. rsloop-0.1.44/vendor/vibeio/Cargo.toml +0 -136
  102. rsloop-0.1.44/vendor/vibeio/benches/runtime.rs +0 -52
  103. {rsloop-0.1.44 → rsloop-0.1.46}/.cargo/config.toml +0 -0
  104. {rsloop-0.1.44 → rsloop-0.1.46}/.github/workflows/anyio.yml +0 -0
  105. {rsloop-0.1.44 → rsloop-0.1.46}/.github/workflows/kani.yml +0 -0
  106. {rsloop-0.1.44 → rsloop-0.1.46}/.github/workflows/mkdocs.yml +0 -0
  107. {rsloop-0.1.44 → rsloop-0.1.46}/.github/workflows/tests.yml +0 -0
  108. {rsloop-0.1.44 → rsloop-0.1.46}/.github/workflows/update-version.yml +0 -0
  109. {rsloop-0.1.44 → rsloop-0.1.46}/.gitignore +0 -0
  110. {rsloop-0.1.44 → rsloop-0.1.46}/.vscode/settings.json +0 -0
  111. {rsloop-0.1.44 → rsloop-0.1.46}/LICENSE +0 -0
  112. {rsloop-0.1.44 → rsloop-0.1.46}/benches/README.md +0 -0
  113. {rsloop-0.1.44 → rsloop-0.1.46}/benches/check_regression.py +0 -0
  114. {rsloop-0.1.44 → rsloop-0.1.46}/benches/compare_event_loops.py +0 -0
  115. {rsloop-0.1.44 → rsloop-0.1.46}/benches/workload_matrix.py +0 -0
  116. {rsloop-0.1.44 → rsloop-0.1.46}/docs/development.md +0 -0
  117. {rsloop-0.1.44 → rsloop-0.1.46}/docs/examples.md +0 -0
  118. {rsloop-0.1.44 → rsloop-0.1.46}/docs/getting-started.md +0 -0
  119. {rsloop-0.1.44 → rsloop-0.1.46}/docs/how-it-works.md +0 -0
  120. {rsloop-0.1.44 → rsloop-0.1.46}/docs/index.md +0 -0
  121. {rsloop-0.1.44 → rsloop-0.1.46}/docs/project-structure.md +0 -0
  122. {rsloop-0.1.44 → rsloop-0.1.46}/docs/rsloop.png +0 -0
  123. {rsloop-0.1.44 → rsloop-0.1.46}/docs/rust-extensions.md +0 -0
  124. {rsloop-0.1.44 → rsloop-0.1.46}/docs/verification.md +0 -0
  125. {rsloop-0.1.44 → rsloop-0.1.46}/examples/01_basics.py +0 -0
  126. {rsloop-0.1.44 → rsloop-0.1.46}/examples/02_fd_and_sockets.py +0 -0
  127. {rsloop-0.1.44 → rsloop-0.1.46}/examples/03_streams.py +0 -0
  128. {rsloop-0.1.44 → rsloop-0.1.46}/examples/04_unix_and_accepted_socket.py +0 -0
  129. {rsloop-0.1.44 → rsloop-0.1.46}/examples/05_pipes_signals_subprocesses.py +0 -0
  130. {rsloop-0.1.44 → rsloop-0.1.46}/examples/README.md +0 -0
  131. {rsloop-0.1.44 → rsloop-0.1.46}/examples/fastapi_service.py +0 -0
  132. {rsloop-0.1.44 → rsloop-0.1.46}/examples/picows_server.py +0 -0
  133. {rsloop-0.1.44 → rsloop-0.1.46}/examples/picows_test.py +0 -0
  134. {rsloop-0.1.44 → rsloop-0.1.46}/examples/wsbench_websockets.py +0 -0
  135. {rsloop-0.1.44 → rsloop-0.1.46}/justfile +0 -0
  136. {rsloop-0.1.44 → rsloop-0.1.46}/mkdocs.yml +0 -0
  137. {rsloop-0.1.44 → rsloop-0.1.46}/pyrightconfig.json +0 -0
  138. {rsloop-0.1.44 → rsloop-0.1.46}/python/rsloop/__init__.py +0 -0
  139. {rsloop-0.1.44 → rsloop-0.1.46}/python/rsloop/__init__.pyi +0 -0
  140. {rsloop-0.1.44 → rsloop-0.1.46}/python/rsloop/_bootstrap.py +0 -0
  141. {rsloop-0.1.44 → rsloop-0.1.46}/python/rsloop/_loop.pyi +0 -0
  142. {rsloop-0.1.44 → rsloop-0.1.46}/python/rsloop/_loop_compat.py +0 -0
  143. {rsloop-0.1.44 → rsloop-0.1.46}/python/rsloop/_profile.py +0 -0
  144. {rsloop-0.1.44 → rsloop-0.1.46}/python/rsloop/_run.py +0 -0
  145. {rsloop-0.1.44 → rsloop-0.1.46}/python/rsloop/py.typed +0 -0
  146. {rsloop-0.1.44 → rsloop-0.1.46}/qualirs.toml +0 -0
  147. {rsloop-0.1.44 → rsloop-0.1.46}/scripts/build-wheels.sh +0 -0
  148. {rsloop-0.1.44 → rsloop-0.1.46}/scripts/generate_test_tls_certs.py +0 -0
  149. {rsloop-0.1.44 → rsloop-0.1.46}/scripts/prepare_anyio_rsloop_tests.py +0 -0
  150. {rsloop-0.1.44 → rsloop-0.1.46}/scripts/python-versions.sh +0 -0
  151. {rsloop-0.1.44 → rsloop-0.1.46}/scripts/run_python_tests.py +0 -0
  152. {rsloop-0.1.44 → rsloop-0.1.46}/scripts/run_rust_tests.py +0 -0
  153. {rsloop-0.1.44 → rsloop-0.1.46}/scripts/test-supported-pythons.sh +0 -0
  154. {rsloop-0.1.44 → rsloop-0.1.46}/src/async_event.rs +0 -0
  155. {rsloop-0.1.44 → rsloop-0.1.46}/src/bindings/loop_api/asyncgens.rs +0 -0
  156. {rsloop-0.1.44 → rsloop-0.1.46}/src/bindings/loop_api/asyncio_cache.rs +0 -0
  157. {rsloop-0.1.44 → rsloop-0.1.46}/src/bindings/loop_api/executor.rs +0 -0
  158. {rsloop-0.1.44 → rsloop-0.1.46}/src/bindings/loop_api/ffi_helpers.rs +0 -0
  159. {rsloop-0.1.44 → rsloop-0.1.46}/src/bindings/loop_api/lifecycle.rs +0 -0
  160. {rsloop-0.1.44 → rsloop-0.1.46}/src/bindings/loop_api/pipes.rs +0 -0
  161. {rsloop-0.1.44 → rsloop-0.1.46}/src/bindings/loop_api/pre_exec.rs +0 -0
  162. {rsloop-0.1.44 → rsloop-0.1.46}/src/bindings/loop_api/process_handles.rs +0 -0
  163. {rsloop-0.1.44 → rsloop-0.1.46}/src/bindings/loop_api/process_spawn.rs +0 -0
  164. {rsloop-0.1.44 → rsloop-0.1.46}/src/bindings/loop_api/process_stdio.rs +0 -0
  165. {rsloop-0.1.44 → rsloop-0.1.46}/src/bindings/loop_api/signals.rs +0 -0
  166. {rsloop-0.1.44 → rsloop-0.1.46}/src/bindings/loop_api/sock_ops.rs +0 -0
  167. {rsloop-0.1.44 → rsloop-0.1.46}/src/bindings/loop_api/socket_connect.rs +0 -0
  168. {rsloop-0.1.44 → rsloop-0.1.46}/src/bindings/loop_api/sockets.rs +0 -0
  169. {rsloop-0.1.44 → rsloop-0.1.46}/src/bindings/loop_api/spawn_env.rs +0 -0
  170. {rsloop-0.1.44 → rsloop-0.1.46}/src/bindings/loop_api/tasks.rs +0 -0
  171. {rsloop-0.1.44 → rsloop-0.1.46}/src/bindings/loop_api/tls_params.rs +0 -0
  172. {rsloop-0.1.44 → rsloop-0.1.46}/src/bindings/loop_api/watchers.rs +0 -0
  173. {rsloop-0.1.44 → rsloop-0.1.46}/src/bindings/loop_api.rs +0 -0
  174. {rsloop-0.1.44 → rsloop-0.1.46}/src/bindings/mod.rs +0 -0
  175. {rsloop-0.1.44 → rsloop-0.1.46}/src/blocking.rs +0 -0
  176. {rsloop-0.1.44 → rsloop-0.1.46}/src/build_metadata.rs +0 -0
  177. {rsloop-0.1.44 → rsloop-0.1.46}/src/context.rs +0 -0
  178. {rsloop-0.1.44 → rsloop-0.1.46}/src/engine/commands.rs +0 -0
  179. {rsloop-0.1.44 → rsloop-0.1.46}/src/engine/dispatcher/timer_entry.rs +0 -0
  180. {rsloop-0.1.44 → rsloop-0.1.46}/src/engine/mod.rs +0 -0
  181. {rsloop-0.1.44 → rsloop-0.1.46}/src/errors.rs +0 -0
  182. {rsloop-0.1.44 → rsloop-0.1.46}/src/module_init.rs +0 -0
  183. {rsloop-0.1.44 → rsloop-0.1.46}/src/platform/fd/windows.rs +0 -0
  184. {rsloop-0.1.44 → rsloop-0.1.46}/src/platform/mod.rs +0 -0
  185. {rsloop-0.1.44 → rsloop-0.1.46}/src/python_names.rs +0 -0
  186. {rsloop-0.1.44 → rsloop-0.1.46}/src/rust_async.rs +0 -0
  187. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/mod.rs +0 -0
  188. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/process/core_protocol.rs +0 -0
  189. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/process/core_state.rs +0 -0
  190. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/process/mod.rs +0 -0
  191. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/process/params.rs +0 -0
  192. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/process/py_pipes.rs +0 -0
  193. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/process/py_transport.rs +0 -0
  194. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/process/spawn.rs +0 -0
  195. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/buffers.rs +0 -0
  196. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/builder.rs +0 -0
  197. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/core_state.rs +0 -0
  198. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/fast.rs +0 -0
  199. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/io_targets.rs +0 -0
  200. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/mod.rs +0 -0
  201. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/pipe_transport.rs +0 -0
  202. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/platform.rs +0 -0
  203. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/poll.rs +0 -0
  204. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/protocol.rs +0 -0
  205. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/py_server.rs +0 -0
  206. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/server_core.rs +0 -0
  207. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/server_types.rs +0 -0
  208. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/stats.rs +0 -0
  209. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/tuning.rs +0 -0
  210. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/worker.rs +0 -0
  211. {rsloop-0.1.44 → rsloop-0.1.46}/src/transport/stream/write_queue.rs +0 -0
  212. {rsloop-0.1.44 → rsloop-0.1.46}/src/verification.rs +0 -0
  213. rsloop-0.1.44/vendor/vibeio/README.md → rsloop-0.1.46/src/vibeio/UPSTREAM.md +0 -0
  214. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/blocking/default.rs +0 -0
  215. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/blocking/mod.rs +0 -0
  216. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/fs/metadata.rs +0 -0
  217. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/io/buf.rs +0 -0
  218. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/net/mod.rs +0 -0
  219. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/time/interval.rs +0 -0
  220. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/time/timeout.rs +0 -0
  221. {rsloop-0.1.44/vendor/vibeio/src → rsloop-0.1.46/src/vibeio}/timer.rs +1 -1
  222. {rsloop-0.1.44 → rsloop-0.1.46}/tests/packages/_smoke.py +0 -0
  223. {rsloop-0.1.44 → rsloop-0.1.46}/tests/packages/aiohttp_test.py +0 -0
  224. {rsloop-0.1.44 → rsloop-0.1.46}/tests/packages/anyio_test.py +0 -0
  225. {rsloop-0.1.44 → rsloop-0.1.46}/tests/packages/daphne_test.py +0 -0
  226. {rsloop-0.1.44 → rsloop-0.1.46}/tests/packages/django_asgi_test.py +0 -0
  227. {rsloop-0.1.44 → rsloop-0.1.46}/tests/packages/falcon_test.py +0 -0
  228. {rsloop-0.1.44 → rsloop-0.1.46}/tests/packages/fastapi_test.py +0 -0
  229. {rsloop-0.1.44 → rsloop-0.1.46}/tests/packages/faststream_test.py +0 -0
  230. {rsloop-0.1.44 → rsloop-0.1.46}/tests/packages/hypercorn_test.py +0 -0
  231. {rsloop-0.1.44 → rsloop-0.1.46}/tests/packages/litestar_granian_test.py +0 -0
  232. {rsloop-0.1.44 → rsloop-0.1.46}/tests/packages/litestar_test.py +0 -0
  233. {rsloop-0.1.44 → rsloop-0.1.46}/tests/packages/mangum_test.py +0 -0
  234. {rsloop-0.1.44 → rsloop-0.1.46}/tests/packages/quart_test.py +0 -0
  235. {rsloop-0.1.44 → rsloop-0.1.46}/tests/packages/sanic_test.py +0 -0
  236. {rsloop-0.1.44 → rsloop-0.1.46}/tests/packages/starlette_test.py +0 -0
  237. {rsloop-0.1.44 → rsloop-0.1.46}/tests/packages/uvicorn_test.py +0 -0
  238. {rsloop-0.1.44 → rsloop-0.1.46}/tests/proptest-regressions/transport/stream/fast.txt +0 -0
  239. {rsloop-0.1.44 → rsloop-0.1.46}/tests/test_compat.py +0 -0
  240. {rsloop-0.1.44 → rsloop-0.1.46}/tests/test_free_threading.py +0 -0
  241. {rsloop-0.1.44 → rsloop-0.1.46}/tests/test_public_api.py +0 -0
  242. {rsloop-0.1.44 → rsloop-0.1.46}/tests/test_run.py +0 -0
  243. {rsloop-0.1.44 → rsloop-0.1.46}/tests/test_stream_reader.py +0 -0
  244. {rsloop-0.1.44 → rsloop-0.1.46}/tests/test_tls.py +0 -0
@@ -62,7 +62,8 @@ jobs:
62
62
  - name: Set up Rust
63
63
  uses: dtolnay/rust-toolchain@stable
64
64
  with:
65
- toolchain: 1.95.0
65
+ toolchain: stable
66
+ components: llvm-tools-preview
66
67
 
67
68
  - name: Cache Cargo registry and target
68
69
  uses: Swatinem/rust-cache@v2
@@ -72,7 +73,7 @@ jobs:
72
73
  shell: bash
73
74
  env:
74
75
  RSLOOP_PYTHON_VERSIONS: ${{ matrix.python_versions }}
75
- run: scripts/build-wheels.sh --out dist --target "${{ matrix.rust_target }}"
76
+ run: scripts/build-pgo-wheels.sh --out dist --target "${{ matrix.rust_target }}"
76
77
 
77
78
  - name: Upload wheel artifacts
78
79
  uses: actions/upload-artifact@v4
@@ -102,7 +103,7 @@ jobs:
102
103
  - name: Set up Rust
103
104
  uses: dtolnay/rust-toolchain@stable
104
105
  with:
105
- toolchain: 1.95.0
106
+ toolchain: stable
106
107
 
107
108
  - name: Cache Cargo registry and target
108
109
  uses: Swatinem/rust-cache@v2
@@ -197,15 +197,9 @@ dependencies = [
197
197
 
198
198
  [[package]]
199
199
  name = "bitflags"
200
- version = "1.3.2"
200
+ version = "2.13.1"
201
201
  source = "registry+https://github.com/rust-lang/crates.io-index"
202
- checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
203
-
204
- [[package]]
205
- name = "bitflags"
206
- version = "2.13.0"
207
- source = "registry+https://github.com/rust-lang/crates.io-index"
208
- checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8"
202
+ checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da"
209
203
 
210
204
  [[package]]
211
205
  name = "blocking"
@@ -522,11 +516,12 @@ checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c"
522
516
 
523
517
  [[package]]
524
518
  name = "io-uring"
525
- version = "0.6.4"
519
+ version = "0.7.14"
526
520
  source = "registry+https://github.com/rust-lang/crates.io-index"
527
- checksum = "595a0399f411a508feb2ec1e970a4a30c249351e30208960d58298de8660b0e5"
521
+ checksum = "d64d8ca234d152948ceaede1f419b6a83983a5ecccaac05fb337a809c96d3aa6"
528
522
  dependencies = [
529
- "bitflags 1.3.2",
523
+ "bitflags",
524
+ "cfg-if",
530
525
  "libc",
531
526
  ]
532
527
 
@@ -568,9 +563,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
568
563
 
569
564
  [[package]]
570
565
  name = "libc"
571
- version = "0.2.186"
566
+ version = "0.2.189"
572
567
  source = "registry+https://github.com/rust-lang/crates.io-index"
573
- checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
568
+ checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
574
569
 
575
570
  [[package]]
576
571
  name = "linux-raw-sys"
@@ -730,33 +725,13 @@ dependencies = [
730
725
  "unicode-ident",
731
726
  ]
732
727
 
733
- [[package]]
734
- name = "profiling"
735
- version = "1.0.18"
736
- source = "registry+https://github.com/rust-lang/crates.io-index"
737
- checksum = "3d595e54a326bc53c1c197b32d295e14b169e3cfeaa8dc82b529f947fba6bcf5"
738
- dependencies = [
739
- "profiling-procmacros",
740
- "tracy-client",
741
- ]
742
-
743
- [[package]]
744
- name = "profiling-procmacros"
745
- version = "1.0.18"
746
- source = "registry+https://github.com/rust-lang/crates.io-index"
747
- checksum = "4488a4a36b9a4ba6b9334a32a39971f77c1436ec82c38707bce707699cc3bbcb"
748
- dependencies = [
749
- "quote",
750
- "syn",
751
- ]
752
-
753
728
  [[package]]
754
729
  name = "proptest"
755
730
  version = "1.11.0"
756
731
  source = "registry+https://github.com/rust-lang/crates.io-index"
757
732
  checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744"
758
733
  dependencies = [
759
- "bitflags 2.13.0",
734
+ "bitflags",
760
735
  "num-traits",
761
736
  "rand",
762
737
  "rand_chacha",
@@ -922,15 +897,19 @@ dependencies = [
922
897
 
923
898
  [[package]]
924
899
  name = "rsloop"
925
- version = "0.1.44"
900
+ version = "0.1.46"
926
901
  dependencies = [
927
902
  "async-io",
928
903
  "async-std",
929
904
  "crossbeam-channel",
905
+ "crossbeam-queue",
930
906
  "futures",
907
+ "futures-util",
908
+ "io-uring",
931
909
  "libc",
932
910
  "memchr",
933
- "profiling",
911
+ "mio",
912
+ "oneshot",
934
913
  "proptest",
935
914
  "pyo3",
936
915
  "pyo3-async-runtimes",
@@ -939,10 +918,10 @@ dependencies = [
939
918
  "rustls-native-certs",
940
919
  "rustls-pemfile",
941
920
  "signal-hook",
921
+ "slab",
942
922
  "socket2",
943
923
  "tokio",
944
924
  "tracy-client",
945
- "vibeio",
946
925
  "windows-sys 0.61.2",
947
926
  ]
948
927
 
@@ -952,7 +931,7 @@ version = "1.1.4"
952
931
  source = "registry+https://github.com/rust-lang/crates.io-index"
953
932
  checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190"
954
933
  dependencies = [
955
- "bitflags 2.13.0",
934
+ "bitflags",
956
935
  "errno",
957
936
  "libc",
958
937
  "linux-raw-sys",
@@ -1043,7 +1022,7 @@ version = "3.7.0"
1043
1022
  source = "registry+https://github.com/rust-lang/crates.io-index"
1044
1023
  checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d"
1045
1024
  dependencies = [
1046
- "bitflags 2.13.0",
1025
+ "bitflags",
1047
1026
  "core-foundation",
1048
1027
  "core-foundation-sys",
1049
1028
  "libc",
@@ -1259,21 +1238,6 @@ version = "1.12.0"
1259
1238
  source = "registry+https://github.com/rust-lang/crates.io-index"
1260
1239
  checksum = "7ba6f5989077681266825251a52748b8c1d8a4ad098cc37e440103d0ea717fc0"
1261
1240
 
1262
- [[package]]
1263
- name = "vibeio"
1264
- version = "0.2.15"
1265
- dependencies = [
1266
- "crossbeam-queue",
1267
- "futures-util",
1268
- "io-uring",
1269
- "libc",
1270
- "mio",
1271
- "oneshot",
1272
- "slab",
1273
- "tokio",
1274
- "windows-sys 0.61.2",
1275
- ]
1276
-
1277
1241
  [[package]]
1278
1242
  name = "wasi"
1279
1243
  version = "0.11.1+wasi-snapshot-preview1"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "rsloop"
3
- version = "0.1.44"
3
+ version = "0.1.46"
4
4
  edition = "2024"
5
5
  description = "An event loop for asyncio written in Rust"
6
6
  license = "Apache-2.0"
@@ -15,29 +15,37 @@ crate-type = ["cdylib", "rlib"]
15
15
 
16
16
  [features]
17
17
  default = []
18
- profiler = ["dep:tracy-client", "profiling/profile-with-tracy"]
18
+ profiler = ["dep:tracy-client"]
19
19
 
20
20
  [dependencies]
21
21
  async-io = "2"
22
22
  async-std = "1"
23
23
  crossbeam-channel = "0.5"
24
+ crossbeam-queue = "0.3"
24
25
  futures = { version = "0.3", default-features = false, features = ["std"] }
26
+ futures-util = "0.3"
25
27
  libc = "0.2"
26
28
  memchr = "2"
27
- profiling = "1"
29
+ mio = "1"
30
+ oneshot = { version = "0.2", features = ["async", "std"] }
28
31
  pyo3 = { version = "0.29.2" }
29
32
  pyo3-async-runtimes = { version = "0.29", features = ["async-std-runtime"] }
30
33
  rustls = "0.23"
31
34
  rustls-native-certs = "0.8"
32
35
  rustls-pemfile = "2"
33
36
  signal-hook = "0.4"
37
+ slab = "0.4"
34
38
  socket2 = "0.6"
35
39
  tokio = { version = "1", default-features = false, features = ["io-util"] }
36
40
  tracy-client = { version = "0.18", default-features = false, features = ["enable", "only-localhost", "sampling"], optional = true }
37
- vibeio = { version = "0.2.15", path = "vendor/vibeio", default-features = false, features = ["time"] }
41
+ [target.'cfg(target_os = "linux")'.dependencies]
42
+ io-uring = "0.7"
43
+
44
+ [target.'cfg(unix)'.dependencies]
45
+ mio = { version = "1", features = ["os-poll", "os-ext"] }
38
46
 
39
47
  [target.'cfg(windows)'.dependencies]
40
- windows-sys = { version = "0.61", features = ["Win32_Foundation", "Win32_Networking_WinSock", "Win32_System_IO", "Win32_System_Pipes", "Win32_System_Threading"] }
48
+ windows-sys = { version = "0.61", features = ["Wdk_Foundation", "Wdk_Storage_FileSystem", "Wdk_System_IO", "Win32_Foundation", "Win32_Networking_WinSock", "Win32_Security", "Win32_Storage_FileSystem", "Win32_System_Console", "Win32_System_IO", "Win32_System_Pipes", "Win32_System_Threading"] }
41
49
 
42
50
  [build-dependencies]
43
51
  pyo3-build-config = "0.29.2"
@@ -83,7 +91,7 @@ borrow_as_ptr = "allow"
83
91
  ref_as_ptr = "allow"
84
92
 
85
93
  [lints.rust]
86
- unexpected_cfgs = { level = "warn", check-cfg = ["cfg(kani)"] }
94
+ unexpected_cfgs = { level = "warn", check-cfg = ["cfg(kani)", "cfg(musl_v1_2_3)", "cfg(syscall_accept4)", "cfg(syscall_pipe2)", "cfg(feature, values(\"blocking-default\", \"fs\", \"pipe\", \"process\", \"signal\", \"splice\", \"stdio\"))"] }
87
95
 
88
96
  [package.metadata.kani.flags]
89
97
  # Force every proof that reaches a loop to state and review its own bound.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rsloop
3
- Version: 0.1.44
3
+ Version: 0.1.46
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: Apache Software License
@@ -379,6 +379,27 @@ Build release wheels into `dist/wheels`:
379
379
  scripts/build-wheels.sh
380
380
  ```
381
381
 
382
+ Build the published-wheel configuration with profile-guided optimization:
383
+
384
+ ```bash
385
+ rustup component add llvm-tools-preview
386
+ scripts/build-pgo-wheels.sh
387
+ ```
388
+
389
+ For each requested Python ABI, the PGO wrapper creates an instrumented wheel,
390
+ trains it on sustained HTTP, TLS, WebSocket, mixed-stream, bulk-transfer,
391
+ idle-connection, callback, task, and TCP workloads, merges the resulting LLVM
392
+ profiles, and builds that ABI's final wheel with its matching profile. Per-ABI
393
+ training avoids discarding counters when PyO3's generated control flow differs
394
+ between Python versions or free-threaded builds. The target must be native
395
+ because the instrumented extension runs during training.
396
+
397
+ Set `RSLOOP_PGO_SCENARIOS` to override the comma-separated network scenarios.
398
+ Tagged and manually dispatched wheel workflows use PGO on every supported
399
+ platform except Windows ARM64. Rust profile-generation binaries currently
400
+ crash on that target ([rust-lang/rust#156675](https://github.com/rust-lang/rust/issues/156675)),
401
+ so it temporarily falls back to the normal fat-LTO release build.
402
+
382
403
  [`scripts/build-wheels.sh`](./scripts/build-wheels.sh) currently defaults to
383
404
  CPython `3.10 3.11 3.12 3.13 3.14`, and
384
405
  uses `uv python install` / `uv python find` to locate interpreters.
@@ -347,6 +347,27 @@ Build release wheels into `dist/wheels`:
347
347
  scripts/build-wheels.sh
348
348
  ```
349
349
 
350
+ Build the published-wheel configuration with profile-guided optimization:
351
+
352
+ ```bash
353
+ rustup component add llvm-tools-preview
354
+ scripts/build-pgo-wheels.sh
355
+ ```
356
+
357
+ For each requested Python ABI, the PGO wrapper creates an instrumented wheel,
358
+ trains it on sustained HTTP, TLS, WebSocket, mixed-stream, bulk-transfer,
359
+ idle-connection, callback, task, and TCP workloads, merges the resulting LLVM
360
+ profiles, and builds that ABI's final wheel with its matching profile. Per-ABI
361
+ training avoids discarding counters when PyO3's generated control flow differs
362
+ between Python versions or free-threaded builds. The target must be native
363
+ because the instrumented extension runs during training.
364
+
365
+ Set `RSLOOP_PGO_SCENARIOS` to override the comma-separated network scenarios.
366
+ Tagged and manually dispatched wheel workflows use PGO on every supported
367
+ platform except Windows ARM64. Rust profile-generation binaries currently
368
+ crash on that target ([rust-lang/rust#156675](https://github.com/rust-lang/rust/issues/156675)),
369
+ so it temporarily falls back to the normal fat-LTO release build.
370
+
350
371
  [`scripts/build-wheels.sh`](./scripts/build-wheels.sh) currently defaults to
351
372
  CPython `3.10 3.11 3.12 3.13 3.14`, and
352
373
  uses `uv python install` / `uv python find` to locate interpreters.
@@ -1,4 +1,7 @@
1
1
  fn main() {
2
+ pyo3_build_config::use_pyo3_cfgs();
3
+ pyo3_build_config::add_extension_module_link_args();
4
+
2
5
  let musl = std::env::var("CARGO_CFG_TARGET_ENV").unwrap_or_default() == "musl";
3
6
  let musl_v1_2_3 = std::env::var("RUST_LIBC_UNSTABLE_MUSL_V1_2_3").is_ok();
4
7
  println!("cargo:rerun-if-env-changed=RUST_LIBC_UNSTABLE_MUSL_V1_2_3");
@@ -4,7 +4,7 @@ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "rsloop"
7
- version = "0.1.44"
7
+ version = "0.1.46"
8
8
  description = "An event loop for asyncio written in Rust"
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
@@ -0,0 +1,200 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
5
+ source "${ROOT_DIR}/scripts/python-versions.sh"
6
+
7
+ DEFAULT_PGO_SCENARIOS="http_keepalive,tls_http,websocket_messages,websocket_tls,mixed_streams,bulk_transfer,idle_connections"
8
+ BUILD_WHEEL_ARGS=("$@")
9
+ RUST_TARGET="${RSLOOP_RUST_TARGET:-}"
10
+ INSTALL_PYTHONS=1
11
+ MATURIN_ARGS=()
12
+
13
+ usage() {
14
+ cat <<'EOF'
15
+ Build PGO-optimized release wheels for rsloop.
16
+
17
+ Usage:
18
+ scripts/build-pgo-wheels.sh [build-wheels options] [-- maturin args...]
19
+
20
+ This wrapper accepts the same options as scripts/build-wheels.sh. For each
21
+ requested Python ABI, it builds an instrumented native wheel, trains it with
22
+ representative traffic, merges the LLVM profiles, and builds that ABI's final
23
+ wheel with its matching profile.
24
+
25
+ Environment:
26
+ RSLOOP_PGO_SCENARIOS Comma-separated workload-matrix training scenarios
27
+
28
+ PGO requires a native target and the Rust llvm-tools-preview component.
29
+ EOF
30
+ }
31
+
32
+ host_rust_target() {
33
+ rustc -vV | sed -n 's/^host: //p'
34
+ }
35
+
36
+ native_path() {
37
+ case "${OSTYPE:-}" in
38
+ msys*|cygwin*) cygpath -m "$1" ;;
39
+ *) printf '%s\n' "$1" ;;
40
+ esac
41
+ }
42
+
43
+ shell_path() {
44
+ case "${OSTYPE:-}" in
45
+ msys*|cygwin*) cygpath -u "$1" ;;
46
+ *) printf '%s\n' "$1" ;;
47
+ esac
48
+ }
49
+
50
+ while (($#)); do
51
+ case "$1" in
52
+ -o|--out)
53
+ (($# >= 2)) || { echo "missing value for $1" >&2; exit 1; }
54
+ shift 2
55
+ ;;
56
+ -t|--target)
57
+ (($# >= 2)) || { echo "missing value for $1" >&2; exit 1; }
58
+ RUST_TARGET="$2"
59
+ shift 2
60
+ ;;
61
+ --skip-python-install)
62
+ INSTALL_PYTHONS=0
63
+ shift
64
+ ;;
65
+ -h|--help)
66
+ usage
67
+ printf '\nUnderlying wheel-builder options:\n\n'
68
+ "${ROOT_DIR}/scripts/build-wheels.sh" --help
69
+ exit 0
70
+ ;;
71
+ --)
72
+ shift
73
+ MATURIN_ARGS=("$@")
74
+ break
75
+ ;;
76
+ *)
77
+ echo "unknown argument: $1" >&2
78
+ usage >&2
79
+ exit 1
80
+ ;;
81
+ esac
82
+ done
83
+
84
+ cd "$ROOT_DIR"
85
+ HOST_RUST_TARGET="$(host_rust_target)"
86
+ if [[ -n "$RUST_TARGET" && "$RUST_TARGET" != "$HOST_RUST_TARGET" ]]; then
87
+ echo "PGO requires a native target because the instrumented wheel must run during training" >&2
88
+ echo "host target: ${HOST_RUST_TARGET}; requested target: ${RUST_TARGET}" >&2
89
+ exit 1
90
+ fi
91
+ if [[ "$RUST_TARGET" == *-apple-darwin ]]; then
92
+ export MACOSX_DEPLOYMENT_TARGET="${MACOSX_DEPLOYMENT_TARGET:-13.0}"
93
+ fi
94
+ if [[ "$RUST_TARGET" == "aarch64-pc-windows-msvc" ]]; then
95
+ # rustc profile-generate binaries currently crash on native Windows ARM64:
96
+ # https://github.com/rust-lang/rust/issues/156675
97
+ echo "PGO is unavailable on Windows ARM64; building a normal fat-LTO release wheel"
98
+ export RUSTFLAGS="${RUSTFLAGS:-} -Clink-arg=/arm64hazardfree"
99
+ exec "${ROOT_DIR}/scripts/build-wheels.sh" "${BUILD_WHEEL_ARGS[@]}"
100
+ fi
101
+
102
+ RSLOOP_PYTHON_VERSIONS_OVERRIDE="${RSLOOP_PYTHON_VERSIONS:-}"
103
+ rsloop_load_python_versions "$RUST_TARGET"
104
+ PYTHON_VERSIONS=("${RSLOOP_PYTHON_VERSIONS[@]}")
105
+ PGO_SCENARIOS="${RSLOOP_PGO_SCENARIOS:-$DEFAULT_PGO_SCENARIOS}"
106
+
107
+ rust_sysroot="$(shell_path "$(rustc --print sysroot)")"
108
+ llvm_profdata="${rust_sysroot}/lib/rustlib/${HOST_RUST_TARGET}/bin/llvm-profdata"
109
+ if [[ "${OSTYPE:-}" == msys* || "${OSTYPE:-}" == cygwin* ]]; then
110
+ llvm_profdata+=".exe"
111
+ fi
112
+ if [[ ! -x "$llvm_profdata" ]]; then
113
+ echo "llvm-profdata was not found at ${llvm_profdata}" >&2
114
+ echo "install it with: rustup component add llvm-tools-preview" >&2
115
+ exit 1
116
+ fi
117
+
118
+ PGO_WORK_DIR="$(mktemp -d "${TMPDIR:-/tmp}/rsloop-wheel-pgo.XXXXXX")"
119
+ cleanup() {
120
+ if [[ -n "${PGO_WORK_DIR:-}" && -d "$PGO_WORK_DIR" ]]; then
121
+ rm -rf -- "$PGO_WORK_DIR"
122
+ fi
123
+ }
124
+ trap cleanup EXIT
125
+
126
+ PROFILE_DIR="${PGO_WORK_DIR}/profiles"
127
+ TARGET_GENERATE="$(native_path "${PGO_WORK_DIR}/target-generate")"
128
+ TARGET_USE="$(native_path "${PGO_WORK_DIR}/target-use")"
129
+ MERGED_PROFILE="${PGO_WORK_DIR}/merged.profdata"
130
+ mkdir -p "$PROFILE_DIR"
131
+ BASE_RUSTFLAGS="${RUSTFLAGS:-}"
132
+ GENERATE_RUSTFLAGS="${BASE_RUSTFLAGS} -Cprofile-generate=$(native_path "$PROFILE_DIR")"
133
+ USE_RUSTFLAGS="${BASE_RUSTFLAGS} -Cprofile-use=$(native_path "$MERGED_PROFILE") -Cllvm-args=-pgo-warn-missing-function"
134
+
135
+ for version in "${PYTHON_VERSIONS[@]}"; do
136
+ python_request="$version"
137
+ if [[ -n "$RUST_TARGET" ]]; then
138
+ python_request="$(rsloop_target_python_request "$version" "$RUST_TARGET")"
139
+ fi
140
+ if (( INSTALL_PYTHONS )); then
141
+ uv python install "$python_request"
142
+ fi
143
+
144
+ version_key="${version//[^a-zA-Z0-9]/_}"
145
+ version_dir="${PGO_WORK_DIR}/${version_key}"
146
+ wheel_dir="${version_dir}/instrumented-wheel"
147
+ tls_dir="${version_dir}/tls"
148
+ training_venv="${version_dir}/venv"
149
+ mkdir -p "$wheel_dir"
150
+ find "$PROFILE_DIR" -maxdepth 1 -type f -name '*.profraw' -delete
151
+
152
+ instrumented_build=(uv run --no-project --python "$python_request" --with maturin maturin build --release --interpreter "$(uv python find "$python_request")" --out "$wheel_dir")
153
+ if [[ -n "$RUST_TARGET" ]]; then
154
+ instrumented_build+=(--target "$RUST_TARGET")
155
+ fi
156
+ if ((${#MATURIN_ARGS[@]})); then
157
+ instrumented_build+=("${MATURIN_ARGS[@]}")
158
+ fi
159
+ echo "Building instrumented PGO training wheel for Python ${version}"
160
+ CARGO_TARGET_DIR="$TARGET_GENERATE" RUSTFLAGS="$GENERATE_RUSTFLAGS" "${instrumented_build[@]}"
161
+
162
+ shopt -s nullglob
163
+ instrumented_wheels=("$wheel_dir"/*.whl)
164
+ shopt -u nullglob
165
+ if ((${#instrumented_wheels[@]} != 1)); then
166
+ echo "expected one instrumented training wheel, found ${#instrumented_wheels[@]}" >&2
167
+ exit 1
168
+ fi
169
+
170
+ uv venv --no-project --python "$python_request" "$training_venv"
171
+ if [[ -x "$training_venv/Scripts/python.exe" ]]; then
172
+ training_python="$training_venv/Scripts/python.exe"
173
+ else
174
+ training_python="$training_venv/bin/python"
175
+ fi
176
+ uv pip install --python "$training_python" "${instrumented_wheels[0]}"
177
+ "$training_python" scripts/generate_test_tls_certs.py "$tls_dir"
178
+
179
+ echo "Training Python ${version} PGO with sustained representative network traffic"
180
+ "$training_python" benches/workload_matrix.py --loops rsloop --scenarios "$PGO_SCENARIOS" --sustained --tls-dir "$tls_dir"
181
+ echo "Training Python ${version} PGO with callbacks, tasks, and TCP streams"
182
+ "$training_python" benches/compare_event_loops.py --loops rsloop
183
+
184
+ shopt -s nullglob
185
+ raw_profiles=("$PROFILE_DIR"/*.profraw)
186
+ shopt -u nullglob
187
+ if ((${#raw_profiles[@]} == 0)); then
188
+ echo "PGO training produced no .profraw files for Python ${version}" >&2
189
+ exit 1
190
+ fi
191
+
192
+ echo "Merging ${#raw_profiles[@]} LLVM profile shards for Python ${version}"
193
+ "$llvm_profdata" merge -o "$MERGED_PROFILE" "${raw_profiles[@]}"
194
+ echo "Building final Python ${version} wheel with its matching PGO profile"
195
+ RSLOOP_PYTHON_VERSIONS="$version" \
196
+ CARGO_TARGET_DIR="$TARGET_USE" \
197
+ RUSTFLAGS="$USE_RUSTFLAGS" \
198
+ "${ROOT_DIR}/scripts/build-wheels.sh" "${BUILD_WHEEL_ARGS[@]}"
199
+ rm -rf -- "$version_dir"
200
+ done
@@ -37,7 +37,7 @@ pub(super) fn create_connection<'py>(
37
37
  py: Python<'py>,
38
38
  params: CreateConnectionParams,
39
39
  ) -> PyResult<Bound<'py, PyAny>> {
40
- profiling::scope!("PyLoop::create_connection");
40
+ crate::profile_scope!("PyLoop::create_connection");
41
41
  let CreateConnectionParams {
42
42
  protocol_factory,
43
43
  host,
@@ -146,7 +146,7 @@ pub(super) fn create_connection_transport(
146
146
  sock: Py<PyAny>,
147
147
  tls: TlsParams,
148
148
  ) -> PyResult<Py<PyAny>> {
149
- profiling::scope!("PyLoop::_create_connection_transport");
149
+ crate::profile_scope!("PyLoop::_create_connection_transport");
150
150
  tls.validate()?;
151
151
 
152
152
  let env = LoopSpawnEnv::capture(py, &slf)?;
@@ -214,7 +214,7 @@ pub(super) fn connect_accepted_socket<'py>(
214
214
  sock: Py<PyAny>,
215
215
  tls: TlsParams,
216
216
  ) -> PyResult<Bound<'py, PyAny>> {
217
- profiling::scope!("PyLoop::connect_accepted_socket");
217
+ crate::profile_scope!("PyLoop::connect_accepted_socket");
218
218
  tls.validate()?;
219
219
 
220
220
  let locals = PyLoop::task_locals(py, &slf)?;
@@ -250,7 +250,7 @@ pub(super) fn start_tls<'py>(
250
250
  tls: TlsParams,
251
251
  server_side: bool,
252
252
  ) -> PyResult<Bound<'py, PyAny>> {
253
- profiling::scope!("PyLoop::start_tls");
253
+ crate::profile_scope!("PyLoop::start_tls");
254
254
  let locals = PyLoop::task_locals(py, &slf)?;
255
255
  let locals_for_barrier = locals.clone();
256
256
  let transport: Py<PyStreamTransport> = transport.extract(py)?;
@@ -137,13 +137,13 @@ impl PyLoop {
137
137
  self.core.set_debug(enabled);
138
138
  }
139
139
 
140
- #[profiling::function]
141
140
  fn run_forever(slf: Py<Self>, py: Python<'_>) -> PyResult<()> {
141
+ crate::profile_function!();
142
142
  lifecycle::run_forever(slf, py)
143
143
  }
144
144
 
145
- #[profiling::function]
146
145
  fn run_until_complete(slf: Py<Self>, py: Python<'_>, future: Py<PyAny>) -> PyResult<Py<PyAny>> {
146
+ crate::profile_function!();
147
147
  lifecycle::run_until_complete(slf, py, future)
148
148
  }
149
149
 
@@ -42,7 +42,7 @@ pub(super) fn create_server<'py>(
42
42
  py: Python<'py>,
43
43
  params: CreateServerParams,
44
44
  ) -> PyResult<Bound<'py, PyAny>> {
45
- profiling::scope!("PyLoop::create_server");
45
+ crate::profile_scope!("PyLoop::create_server");
46
46
  let CreateServerParams {
47
47
  protocol_factory,
48
48
  host,
@@ -129,7 +129,7 @@ impl ReadyCallback {
129
129
  /// A nested-context error falls back to direct invocation because that means
130
130
  /// the desired context is already active on this thread.
131
131
  pub fn invoke(&self, py: Python<'_>) -> PyResult<Py<PyAny>> {
132
- profiling::scope!("ReadyCallback::invoke");
132
+ crate::profile_scope!("ReadyCallback::invoke");
133
133
  if !self.context_needs_run {
134
134
  return self.invoke_direct(py);
135
135
  }
@@ -152,7 +152,7 @@ impl ReadyCallback {
152
152
  }
153
153
 
154
154
  fn invoke_direct(&self, py: Python<'_>) -> PyResult<Py<PyAny>> {
155
- profiling::scope!("ReadyCallback::invoke_direct");
155
+ crate::profile_scope!("ReadyCallback::invoke_direct");
156
156
  match &self.args {
157
157
  CallbackArgs::None => call_callback_noargs(py, &self.callback),
158
158
  CallbackArgs::One(arg) => call_callback_onearg(py, &self.callback, arg),