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
Profiler statistics (total 49765 samples, 497.65000000000003 seconds) | |
num time/ total | |
Name calls call(ms) samples | |
---------------------------------------------------+------+-------+----------- | |
(step! <env-adsr>) 52920000 0.0016 8512( 17%) | |
(set-stereo! <stereo-holder> <real> <real>) 55566000 0.0015 8338( 17%) | |
(step! <single-osc>) 26460000 0.0025 6672( 13%) | |
(step! <dual-osc>) 13230000 0.0049 6432( 13%) | |
(next-state! <env>) 52920000 0.0009 4942( 10%) | |
(step! <channel>) 13230000 0.0028 3769( 8%) |
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
(dotimes [n 101] | |
((lambda args | |
(newline) ; ~&, should be fresh-line | |
(let/cc break | |
(case (car args) ; ~[ | |
[(0)] ; ~; | |
[(1) (display (cadr args)) ; ~A | |
(if (zero? (caddr args)) (break))] ; ~v^, ~; | |
[(2)] ; ~; | |
[(3) (display "Fi")] ; Fi~; |
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 expand-cxr (ads) | |
(labels ((expand (ads) | |
(cond | |
((null ads) 'x) | |
((equalp (car ads) #\a) `(cl:car ,(expand (cdr ads)))) | |
(t `(cl:cdr ,(expand (cdr ads))))))) | |
(let* ((nam (coerce `(#\c ,@ads #\r) 'string)) | |
(sym (intern (ecase (readtable-case *cxr-readtable*) | |
((:upcase) (string-upcase nam)) | |
((:downcase) (string-downcase nam)) |
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
(defvar *original-readtable* *readtable*) | |
(defvar *cxr-readtable* (copy-readtable *original-readtable*)) | |
(defconstant +constituents+ | |
(remove-if #'get-macro-character | |
"!$%&0123456789<=>?[]^_{}~.+-*/@ABCDEFGHIJKLMNOPQRTSUVWXYZabcdefghijklmnopqrstuvwxyz")) | |
(defun cxr-reader (stream char) | |
(let* ((chars (loop with cs = `(,char) | |
for c = (peek-char nil stream nil nil t) |
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
<html> | |
<body> | |
<form action="#"> | |
α: <input type="text" id="α" value="0.008"/> | |
σ: <input type="text" id="σ" value="0.05"/> | |
μ: <input type="text" id="μ" value="-0.496"/> | |
<button type="button" onclick="plot()">redraw</button> | |
</form> | |
<canvas id="canvas" width="1000" height="1000"></canvas> |
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
Benchmark: ran giterate0, giterate0-1, giterate0-2, giterate0-3, giterate1, giterate1-1, giterate1-2, giterate2, each for 10 times. | |
giterate0: 6.322 real, 6.310 cpu (6.300 user + 0.010 sys)@1.58/s n=10 | |
giterate0-1: 6.336 real, 6.320 cpu (6.320 user + 0.000 sys)@1.58/s n=10 | |
giterate0-2: 6.583 real, 6.560 cpu (6.560 user + 0.000 sys)@1.52/s n=10 | |
giterate0-3: 6.538 real, 6.520 cpu (6.520 user + 0.000 sys)@1.53/s n=10 | |
giterate1: 7.110 real, 7.110 cpu (7.110 user + 0.000 sys)@1.41/s n=10 | |
giterate1-1: 7.004 real, 7.010 cpu (7.010 user + 0.000 sys)@1.43/s n=10 | |
giterate1-2: 6.564 real, 6.560 cpu (6.560 user + 0.000 sys)@1.52/s n=10 | |
giterate2: 5.977 real, 5.980 cpu (5.980 user + 0.000 sys)@1.67/s n=10 |
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
Benchmark: ran giterate0, giterate0-1, giterate0-2, giterate1, giterate1-1, giterate2, each for 10 times. | |
giterate0: 14.390 real, 21.430 cpu (21.250 user + 0.180 sys)@0.47/s n=10 | |
giterate0-1: 6.278 real, 6.270 cpu ( 6.270 user + 0.000 sys)@1.59/s n=10 | |
giterate0-2: 6.561 real, 6.560 cpu ( 6.560 user + 0.000 sys)@1.52/s n=10 | |
giterate1: 7.057 real, 7.050 cpu ( 7.050 user + 0.000 sys)@1.42/s n=10 | |
giterate1-1: 6.960 real, 6.960 cpu ( 6.960 user + 0.000 sys)@1.44/s n=10 | |
giterate2: 5.934 real, 5.930 cpu ( 5.930 user + 0.000 sys)@1.69/s n=10 | |
Rate giterate0 giterate0-1 giterate0-2 giterate1 giterate1-1 giterate2 | |
giterate0 0/s -- 0.293 0.306 0.329 0.325 0.277 |
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
$ ./gosh -ftest ./t | |
Benchmark: ran giterate0, giterate0-1, giterate1, giterate2, gunfold1, each for 10 times. | |
giterate0: 14.336 real, 21.140 cpu (20.990 user + 0.150 sys)@0.47/s n=10 | |
giterate0-1: 6.291 real, 6.290 cpu ( 6.290 user + 0.000 sys)@1.59/s n=10 | |
giterate1: 7.002 real, 7.000 cpu ( 7.000 user + 0.000 sys)@1.43/s n=10 | |
giterate2: 5.903 real, 5.910 cpu ( 5.910 user + 0.000 sys)@1.69/s n=10 | |
gunfold1: 14.704 real, 14.720 cpu (14.710 user + 0.010 sys)@0.68/s n=10 | |
Rate giterate0 giterate0-1 giterate1 giterate2 gunfold1 | |
giterate0 0/s -- 0.298 0.331 0.280 0.696 |
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
gosh> (let ((cs '())) | |
(dolist (x '(1 2 3 4 5)) | |
(push! cs (lambda () x))) | |
(map (lambda (c) (c)) cs)) | |
(5 4 3 2 1) | |
gosh> (let ((cs '())) | |
(do ((xs '(1 2 3 4 5) (cdr xs))) | |
((null? xs)) | |
(push! cs (lambda () (car xs)))) | |
(map (lambda (c) (c)) cs)) |
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
[1]> (let ((cs ())) | |
(dolist (x '(1 2 3 4 5)) | |
(push #'(lambda () x) cs)) | |
(mapcar #'funcall cs)) | |
(5 5 5 5 5) | |
[2]> (let ((cs ())) | |
(dolist (x '(1 2 3 4 5)) | |
(push (let ((x x)) #'(lambda () x)) cs)) | |
(mapcar #'funcall cs)) | |
(5 4 3 2 1) |