• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moonbitlang / async
78%

Build:
DEFAULT BRANCH: main
Repo Added 16 Jul 2025 06:31AM UTC
Token SVam8y7GsqVBHy5PxskY6pCeNADiBhEa5 regen
Build 1224 Last
Files 143
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH main
branch: main
CHANGE BRANCH
x
Reset
Sync Branches
  • main
  • CI-check-test-programs
  • CI-coverage-js
  • CI-use-new-moon
  • Guest0x0/aqueue-try-get
  • IP-protocol-preference
  • access-server-addr-via-field
  • adapt-compiler-update
  • adapt-language-update
  • adapt-latest-release
  • adapt-new-release
  • add-CI
  • add-leak-check
  • allow-content-encoding
  • android-openssl
  • android-process
  • android-tmpdir
  • aqueue-close
  • aqueue-readme
  • async-bind
  • async-queue
  • async-test
  • atomic_write
  • bench
  • better-msg-for-mingw
  • block-sigchld
  • block-sigpipe
  • buffer-pool
  • buffered-writer
  • cancel-dont-crash-group
  • cancel-open
  • cancel-sync-io
  • change-naming-convention
  • change-spawn-loop-return-type
  • check-cancel-before-IO
  • cleanup-API
  • cleanup-addr
  • cleanup-deprecated
  • cleanup-socket
  • code-review--src-aqueue
  • code-review--src-fs
  • code-review--src-internal-bytes_util
  • code-review--src-internal-c_buffer
  • code-review--src-internal-fd_util
  • code-review--src-internal-time
  • code-review--src-io
  • code-review--src-pipe
  • code-review--src-process
  • code-review--src-socket
  • codex/add-fn-syntax
  • codex/curl-argparse
  • codex/examples-argparse
  • codex/examples-callback-sugar
  • codex/fix-buffer-deprecations
  • codex/fix-moon-format-info
  • codex/fix-moon-stable-deprecations
  • codex/http-server-file-example
  • codex/process-run-checked
  • codex/project-wide-callback-sugar
  • codex/simplify-logger-write
  • codex/simplify-write-string
  • cond-var
  • cond-var-readme
  • debug
  • debug-CI-failure
  • debug-sanitizer-check
  • defer
  • deprecate-non-portable-API
  • detect-pidfd-open-at-runtime
  • dir-op
  • disable-nagle
  • dns-support
  • enable-tests-in-readme
  • enhance-aqueue
  • enhance-process-cancellation
  • enhance-protect-from-cancel
  • enhance-readdir
  • enhance-request
  • enhance-server-example
  • eq-meth
  • evloop-hook
  • faster-test
  • fd-util
  • feat/bench-docker
  • feat/http-client-verify-param
  • feat/ipv6
  • feat/wasm-gc-promise-http
  • feat/wasm-gc-timer-event-loop
  • feature/valtype-more-types
  • fetch-completed-job-in-batch
  • file-lock
  • fix-API
  • fix-MacOS-process
  • fix-MacOS-timestamp-test
  • fix-MacOS-version-detection
  • fix-aqueue-cancel
  • fix-aqueue-close
  • fix-async-cancel
  • fix-buffered-reader
  • fix-bug
  • fix-clang-warnings
  • fix-dead-lock
  • fix-deprecation-warning
  • fix-error-handling
  • fix-fd-leak
  • fix-fmt-info
  • fix-getaddrinfo-leak
  • fix-gzip
  • fix-http-body-length-not-presented
  • fix-http-cookie-handling
  • fix-http-empty-body
  • fix-http-host-header
  • fix-http-passthrough
  • fix-job-lifetime
  • fix-js-backend
  • fix-js-fairness
  • fix-kqueue-timeout
  • fix-leak
  • fix-macos
  • fix-nightly-CI
  • fix-nightly-warnings
  • fix-potential-data-lost
  • fix-process
  • fix-process-collect-output
  • fix-readdir-errno
  • fix-return-immediately
  • fix-socket-equal
  • fix-spawn-after-cancelled
  • fix-spurious-wakeup
  • fix-starvation
  • fix-stdio
  • fix-timestamp-test
  • fix-tls
  • fix-tls-shutdown
  • fix-unstable-CI
  • fix-warnings
  • fix-warnings-2026-01-26
  • fix-warnings-2026-01-27
  • fix-warnings-in-examples
  • fix-windows-compilation
  • fix-windows-process-handling
  • fix-windows-segfault
  • fix-windows-starvation
  • fix-windows-thread-cc
  • fix-writer-write
  • fix/http-host-authority
  • fs-timestamp
  • fs-util
  • fs-walk-filter
  • fs-watch
  • getsockname
  • global-signal-handler
  • group-scoped-defer
  • gzip-compression
  • haoxiang/http2
  • hongbo/add_examples
  • hongbo/async_doc
  • hongbo/c_buffer_docs
  • hongbo/docs
  • hongbo/fix_warnings
  • hongbo/fs_string_view
  • hongbo/helpful_oserror
  • hongbo/io_buffer_docs_only
  • hongbo/io_docs
  • hongbo/next_package_doc
  • hongbo/process_packages
  • hongbo/stable_test_output
  • hongbo/timestamp_test_is_unstable
  • hongbo/tweak
  • hongbo/tweak_aqueue
  • hongbo/tweaks
  • http
  • http-allow-double-close
  • http-client
  • http-content-length
  • http-empty-body
  • http-proxy
  • http-server
  • http-streaming-api
  • ignore-special-headers
  • improve-buffered-reader
  • improve-ws-error
  • io-abstraction
  • io-pipe
  • issues128
  • js-CI-deny-warn
  • js-backend-basic
  • js-fetch
  • lazy-init
  • lift-examples
  • link-and-chmod
  • make-fd-abstract
  • migrate-to-new-syntax
  • misc-bug-fix
  • mkdir
  • modify-fs-api
  • modify-http-api
  • modify-with-timeout
  • moon-pkg
  • more-examples
  • more-file-op
  • more-fs-util
  • move-timer-to-runtime
  • named-pipe
  • no-remote-server-dep
  • one-writer
  • opendir-async
  • optimize
  • optimize-http
  • optional-permission
  • orphan-process
  • os-error-predicate
  • os-string
  • panic-on-bad-spawn
  • poll-wait-handle-EINTR
  • port-in-url
  • pr-event-loop-empty-timer
  • pr-gzip-crc32-index-loop
  • pr-http-update-or-default
  • pr-wasm-gc-shim
  • pread-instead-of-seek
  • process
  • process-accept-view
  • process-cwd
  • process-helper
  • process-spawn-in-group
  • promote-20260310
  • promote-20260512
  • raw-fd
  • reader-read-some
  • realpath
  • recursive-mkdir
  • refactor-UDP-API
  • refactor-code-organization
  • refactor-dir
  • refactor-fs
  • refactor-fstat
  • refactor-job-id
  • refactor-layout
  • refactor-open-flags
  • refactor-pipe
  • refactor-runtime
  • refactor-thread-pool
  • refine-API
  • refine-TCP-API
  • refine-callback-sugar-use
  • refine-process-API
  • refine-process-redirect-API
  • remove-dead-code
  • remove-zero-padding
  • rename
  • rename-replace-behavior
  • retry-error-filter
  • reuse-addr
  • runtime-use-string
  • schannel-tls-server-cert-file
  • seek-should-be-async
  • semaphore
  • semaphore-readme
  • server-helper
  • simplify-any
  • simplify-code
  • simplify-core-alias
  • simplify-tls
  • simplify-websocket
  • socket-get-fd
  • spawn-loop
  • ssl-custom-root
  • stat-no-follow
  • stdio-blocking
  • stdio-cancel
  • stdio-output-write-string
  • tcp_keep_alive
  • test-macos-14
  • test-random-port
  • text-file-util
  • thread-pool
  • tighten-internal-apis
  • timer
  • tls
  • tls-channel-binding
  • tls-error
  • tls-get-certificate
  • tls-sni
  • tmpdir
  • try-indirect-dep
  • try-poll-on-busy
  • tweak-API
  • type-check-on-wasm
  • udp-multicast
  • unimplemented-skip-coverage
  • update-examples-deps
  • update-fmt
  • update-syntax
  • use-native-rate-limit
  • use-nightly-CI
  • utilize-struct-constructor
  • utilize-trait-optional
  • v6-address-scope-id
  • walk-fs
  • websocket-ping
  • windows-access
  • windows-command-line-no-quote
  • windows-coverage
  • windows-fix-calling-convention
  • windows-fs-always-thread
  • windows-handle-should-be-pointer
  • windows-kill-child-on-exit
  • windows-reuse-addr
  • windows-sanitizer-check
  • windows-support
  • worktree-android
  • write-string
  • zero-aqueue
  • zihang/async-util
  • zihang/feat-workspace
  • zihang/websocket

29 May 2026 09:23AM UTC coverage: 77.656% (+0.005%) from 77.651%
378

push

github

Guest0x0
perf(event_loop): short-circuit timer scan when no timers are pending

EventLoop::wait_for_event runs twice per scheduler tick:

  1. self.timers.iter().head() to compute the poll.wait timeout
  2. for timer in self.timers to fire any expired timer callbacks

When the program does no timer work (IO-only loops, pure compute via
pause, queue producer/consumer loops, etc.) the timers SortedSet is
empty but the two iterator-creation and ms_since_epoch() calls still
fire on every tick. A callgrind profile of a pure-pause workload
(single coroutine, pause() x 2.5M) attributes ~7% of all instructions
executed to the timer scan.

Gate both spots on self.timers.is_empty(). When timers are pending the
extra branch is cheap; when they are not, the entire iterator
allocation + ms_since_epoch + loop setup drops out.

pause_loop bench (native, 3-run median):
  baseline: 637 ms
  patched : 469 ms  (-26.4%)

6 of 6 new or added lines in 1 file covered. (100.0%)

3326 of 4283 relevant lines covered (77.66%)

78646.21 hits per line

Relevant lines Covered
Build:
Build:
4283 RELEVANT LINES 3326 COVERED LINES
78646.21 HITS PER LINE
Source Files on main
  • Tree
  • List 143
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
378 main perf(event_loop): short-circuit timer scan when no timers are pending EventLoop::wait_for_event runs twice per scheduler tick: 1. self.timers.iter().head() to compute the poll.wait timeout 2. for timer in self.timers to fire any expired time... push 29 May 2026 09:26AM UTC Guest0x0 github
77.66
376 main polish push 29 May 2026 09:09AM UTC Guest0x0 github
77.65
370 main polish push 29 May 2026 07:10AM UTC Guest0x0 github
77.65
368 main fix aqueue wrongly swallow value on `close` push 29 May 2026 06:47AM UTC Guest0x0 github
77.65
366 main merge test programs into workspace push 29 May 2026 06:37AM UTC Guest0x0 github
77.65
362 main Add fn syntax to trait implementations push 27 May 2026 02:24PM UTC bobzhang github
79.33
358 main fix buffer constructor deprecations push 27 May 2026 01:12PM UTC bobzhang github
79.28
341 main simplify gzip decoder & consume as much data as possible push 21 May 2026 10:31AM UTC Guest0x0 github
79.35
339 main fix fragile test & more meaningful failure message push 21 May 2026 10:18AM UTC Guest0x0 github
79.24
320 main bump minor version push 18 May 2026 03:44AM UTC Guest0x0 github
79.2
See All Builds (1224)

Badge your Repo: async

We detected this repo isn’t badged! Grab the embed code to the right, add it to your repo to show off your code coverage, and when the badge is live hit the refresh button to remove this message.

Could not find badge in README.

Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

Refresh
  • Settings
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc