Skip to content

Instantly share code, notes, and snippets.

@amotta
Created June 27, 2021 10:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amotta/e76197082bb1bf63538ede01872917f3 to your computer and use it in GitHub Desktop.
Save amotta/e76197082bb1bf63538ede01872917f3 to your computer and use it in GitHub Desktop.
#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