Created
June 27, 2021 10:43
-
-
Save amotta/e76197082bb1bf63538ede01872917f3 to your computer and use it in GitHub Desktop.
This file contains 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
#lang racket | |
(require racket/flonum) | |
(define (xy->string x y) | |
(string-append | |
(~r x #:precision 1) "," | |
(~r y #:precision 1))) | |
(define (xy-vectors->string x-vec y-vec) | |
(for/fold ((coordinates "") | |
(separator "") | |
#:result coordinates) | |
((x (in-flvector x-vec)) | |
(y (in-flvector y-vec))) | |
(values (string-append | |
coordinates | |
separator | |
(xy->string x y)) | |
" "))) | |
(require profile-flame-graph) | |
(profile | |
(let | |
((x (make-flvector 100000)) | |
(y (make-flvector 100000))) | |
(xy-vectors->string x y)) | |
#:svg-path "profile.svg" | |
#:preview? #t) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment