Created
April 22, 2020 05:14
-
-
Save shino/47f88eff61234af8db4167f69bfde06d to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env gosh | |
(use scheme.hash-table) | |
(use rfc.base64) | |
(define (main args) | |
(let* ((ht (populate-ht 20000000))) | |
#?=(hash-table-size ht) | |
;; ht is not used, just pass it to avoid GC | |
(decode-base64-loop 100000 ht) | |
0)) | |
(define (decode-base64-loop . (max-count ht)) | |
(let loop ([count 0]) | |
(cond | |
((eq? count max-count) 0) | |
(else | |
(base64-decode-string "QUJDREVGRw==") | |
(loop (+ count 1)))))) | |
(define (populate-ht . (max-count)) | |
(let ((ht (make-hash-table eq?))) | |
(let loop ([count 0]) | |
(cond | |
((eq? count max-count) ht) | |
(else | |
(hash-table-set! ht count (make-string 100 #\x)) | |
(loop (+ count 1))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment