Four changes to Chez Scheme's garbage collector reduce multi-threaded GC pause times by 40-300x at p99, bringing total pause from ~27ms worst-case to sub-millisecond on 12-thread workloads. All changes are in the C runtime (vendor/ChezScheme/c/), require no application code changes, and three of four are enabled by default.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/ChezScheme/boot/pb/equates.h b/ChezScheme/boot/pb/equates.h | |
| index 286854a..005e06b 100644 | |
| --- a/ChezScheme/boot/pb/equates.h | |
| +++ b/ChezScheme/boot/pb/equates.h | |
| @@ -101,8 +101,8 @@ typedef uint64_t U64; | |
| #define bytevector_length_factor 0x8 | |
| #define bytevector_length_offset 0x3 | |
| #define bytevector_type_disp 0x1 | |
| -#define c_entry_name_vector #(thread-context get-thread-context handle-apply-overflood handle-docall-error handle-overflow handle-overflood handle-nonprocedure-symbol thread-list split-and-resize raw-collect-cond raw-collect-thread0-cond raw-tc-mutex raw-terminated-cond activate-thread deactivate-thread unactivate-thread save-errno save-last-error handle-values-error handle-mvlet-error handle-arg-error handle-event-detour foreign-entry install-library-entry get-more-room scan-remembered-set instantiate-code-object Sreturn Scall-one-result Scall-any-results segment-info bignum-mask-test flfloor flceiling flround fltruncate flsin flcos fltan flasin flacos flatan flatan2 flexp fllog fllog2 fl |
╔══════════════════════════════════════════════════════════════════════════════╗ ║ Regex Benchmark: gerbil-pcre (PCRE2+JIT) vs pregexp vs SRFI-115 ║ ╚══════════════════════════════════════════════════════════════════════════════╝
pcre2 = gerbil-pcre with PCRE2 + JIT pre = :std/pregexp (pure Scheme) sre = :std/srfi/115 (pure Scheme, SRE syntax)
us/op = microseconds per operation (lower is better)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| set -eu | |
| # OpenBSD builder | |
| # pkg_add automake autoconf gcc-11 gmake | |
| GERBIL_VERSION=v0.17 | |
| GAMBIT_VERSION=v4.9.4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -*- mode: compilation; default-directory: "~/gambit/" -*- | |
| Compilation started at Mon Aug 6 20:11:42 | |
| cd ~/gambit/ && make -f ~/kunabi/Makefile gambit | |
| system is Darwin | |
| git checkout master && git clean -f && git fetch -a && git reset --hard origin/master | |
| Already on 'master' | |
| Your branch is up-to-date with 'origin/master'. | |
| Warning: Permanently added 'github.com,192.30.255.113' (RSA) to the list of known hosts. | |
| HEAD is now at 91a4ad2 Update tests/test5.ok test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [*] Building Gerbil | |
| [*] Building gerbil stage0 | |
| >>> preparing /cygdrive/c/Users/merc/gerbil/bootstrap | |
| >>> compiling runtime | |
| /usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../../lib/libcygwin.a(libcmain.o): In function `main': | |
| /usr/src/debug/cygwin-2.10.0-1/winsup/cygwin/lib/libcmain.c:37: undefined reference to `WinMain' | |
| /usr/src/debug/cygwin-2.10.0-1/winsup/cygwin/lib/libcmain.c:37:(.text.startup+0x94): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `WinMain' | |
| collect2: error: ld returned 1 exit status | |
| building gerbil/runtime in /cygdrive/c/Users/merc/gerbil/bootstrap/lib | |
| ... compile gx-gambc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from gerbil/base:ubuntu | |
| ENV PATH='/root/gerbil/bin:/usr/local/gambit/current/bin:/bin:/usr/bin:/sbin:/usr/sbin' | |
| ENV GERBIL_HOME=/root/gerbil | |
| RUN apt update -y | |
| RUN apt install -y emacs-nox tmux | |
| CMD bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### Keybase proof | |
| I hereby claim: | |
| * I am ober on github. | |
| * I am lisp (https://keybase.io/lisp) on keybase. | |
| * I have a public key whose fingerprint is CBD7 8720 569B BE32 F060 E3E8 9C95 3681 7159 B703 | |
| To claim this, I am signing this object: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| awk -Wposix 'BEGIN{ printf("{ \"tcp_connections\": [") }; {split($2,src,":");split(src[1],sip,"");split($3,dst,":");split(dst[1],dip,"");if ( NR > 1) printf(",");printf("{");printf("\"srcip\":\"%d.%d.%d.%d\",\"sport\": \"%d\",\"dstip\":\"%d.%d.%d.%d\",\"dport\":\"%d\"}","0x" sip[7] sip[8], "0x" sip[5] sip[6],"0x" sip[3] sip[4],"0x" sip[1] sip[2],"0x" src[2],"0x" dip[7] dip[8], "0x" dip[5] dip[6],"0x" dip[3] dip[4], "0x" dip[1] dip[2],"0x" dst[2]);}END{ print "]}"}' < /proc/net/tcp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun parse-ct-contents (x) | |
| (let* ((records (cdr (elt (read-json-gzip-file x) 0))) | |
| (record-size (length records))) | |
| (dolist (x records) | |
| (let* ((event-time (cdr-assoc :EVENT-TIME x)) | |
| (user-identity (cdr-assoc :USER-IDENTITY x)) | |
| (user-name (cdr-assoc :USER-NAME user-identity)) | |
| (user-key (cdr-assoc :ACCESS-KEY-ID user-identity)) | |
| ;;(user-identity (cdr-assoc :ACCESS-KEY-ID (cdr-assoc :USER-IDENTITY x))) |
NewerOlder