<div dir="ltr">It seems unlikely that anyone does, but could you look at the code on the pkg server to check?<div><br>Robby</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 27, 2014 at 1:42 PM, Vincent St-Amour <span dir="ltr"><<a href="mailto:stamourv@ccs.neu.edu" target="_blank">stamourv@ccs.neu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">[ccing dev]<br>
<br>
I agree. That would also make adding profiling less intrusive than it is<br>
now. Consistency with `time' would also be nice. FWIW, `contract-profile'<br>
behaves like `time'.<br>
<br>
Currently `profile' and `profile-thunk' return whatever the profile<br>
renderer returns. Most renderers print their report and return void.<br>
But, as the documentation mentions, `values' can be used as a renderer<br>
in which case `profile' returns the pre-rendering analyzed profile<br>
data. Returning the result of the profiled expression would break that<br>
behavior.<br>
<br>
On the other hand, it's already possible to get the analyzed data by<br>
invoking the sampler and the analyzer directly. Changing the behavior of<br>
`profile' wouldn't remove that functionality, just make it less<br>
convenient.<br>
<br>
Does anyone rely on that behavior from `profile' and `profile-thunk'?<br>
If not, I think we should change it.<br>
<br>
Vincent<br>
<br>
<br>
<br>
At Sat, 15 Mar 2014 23:12:11 -0400,<br>
<div class="HOEnZb"><div class="h5"><a href="mailto:eric.hanchrow@gmail.com">eric.hanchrow@gmail.com</a> wrote:<br>
><br>
> A new problem report is waiting at<br>
> <a href="http://bugs.racket-lang.org/query/?cmd=view&pr=14404" target="_blank">http://bugs.racket-lang.org/query/?cmd=view&pr=14404</a><br>
><br>
> Reported by Eric Hanchrow for release: 6.0.0.1--2013-12-13(1f1550a/a)<br>
><br>
> *** Description:<br>
> I recently tried to use profile, and didn't closely read its documentation. I naively assumed that it would work similarly to "time" -- namely that I could simply wrap (profile ...) around my code, and my code would continue to run, but would also emit profiling information. But of course profile returns void, so I had to tediously capture my thunk's value myself, and then arrange to have that value passed "outside" of the profile call. Anyway ... I'd like the below snippet to print 9 not just once (from the call to "time"), but twice.<br>
><br>
> *** How to repeat:<br>
> #lang racket<br>
><br>
> (require profile)<br>
><br>
> (displayln (profile (+ 2 3 4)))<br>
> (displayln (time (+ 2 3 4)))<br>
><br>
> *** Environment:<br>
> macosx "Darwin Eric-Hanchrows-MacBook-Pro.local 13.1.0 Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64" (x86_64-macosx/3m) (get-display-depth) = 32<br>
> Human Language: english<br>
> (current-memory-use) 287758760<br>
> Links: (links) = (); (links #:user? #f) = ("contract-profile" "syntax" "mysterx" "sgl" "datalog" "shell-completion" "algol60" "icons" "ds-store" "slatex" "realm" "games" "make" "trace" "plai" "eopl" "lazy" "preprocessor" "profile" "racklog" "mzcom" "schemeunit" "unstable" "frtime" "mrlib" "swindle"); (links #:root? #t) = (#<path:/Users/erichanchrow/Library/Racket/snapshot/pkgs/throw> #<path:/Users/erichanchrow/Library/Racket/snapshot/pkgs/zeromq> #<path:/Users/erichanchrow/Library/Racket/snapshot/pkgs/zmq>); (links #:user? #f #:root? #t) = (#<path:/Applications/Racket v6.0.0.1/share/pkgs/racket-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/main-distribution> #<path:/Applications/Racket v6.0.0.1/share/pkgs/at-exp-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/compatibility> #<path:/Applications/Racket v6.0.0.1/share/pkgs/compiler> #<path:/Applications/Racket v6.0.0.1/share/pkgs/data> #<path:/Applications/Racket v6.0.0.1/share/pkgs/db> #<path:/Applications/Racket<br>
!<br>
> v6.0.0.1/share/pkgs/deinprogramm> #<path:/Applications/Racket v6.0.0.1/share/pkgs/draw> #<path:/Applications/Racket v6.0.0.1/share/pkgs/draw-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/draw-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/drracket> #<path:/Applications/Racket v6.0.0.1/share/pkgs/errortrace> #<path:/Applications/Racket v6.0.0.1/share/pkgs/future-visualizer> #<path:/Applications/Racket v6.0.0.1/share/pkgs/future-visualizer-typed> #<path:/Applications/Racket v6.0.0.1/share/pkgs/gui> #<path:/Applications/Racket v6.0.0.1/share/pkgs/htdp> #<path:/Applications/Racket v6.0.0.1/share/pkgs/html> #<path:/Applications/Racket v6.0.0.1/share/pkgs/images> #<path:/Applications/Racket v6.0.0.1/share/pkgs/macro-debugger> #<path:/Applications/Racket v6.0.0.1/share/pkgs/macro-debugger-text-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/math> #<path:/Applications/Racket v6.0.0.1/share/pkgs/mzscheme> #<path:/Applications/Racket v6.0.0.1/share/pkgs/net> #<path<br>
:!<br>
> /Applications/Racket v6.0.0.1/share/pkgs/parser-tools> #<path:!<br>
> /Applications/Racket v6.0.0.1/share/pkgs/pconvert-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/pict> #<path:/Applications/Racket v6.0.0.1/share/pkgs/picturing-programs> #<path:/Applications/Racket v6.0.0.1/share/pkgs/planet> #<path:/Applications/Racket v6.0.0.1/share/pkgs/plot> #<path:/Applications/Racket v6.0.0.1/share/pkgs/profile> #<path:/Applications/Racket v6.0.0.1/share/pkgs/r5rs> #<path:/Applications/Racket v6.0.0.1/share/pkgs/r6rs> #<path:/Applications/Racket v6.0.0.1/share/pkgs/racket-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/distributed-places> #<path:/Applications/Racket v6.0.0.1/share/pkgs/racket-index> #<path:/Applications/Racket v6.0.0.1/share/pkgs/rackunit> #<path:/Applications/Racket v6.0.0.1/share/pkgs/readline> #<path:/Applications/Racket v6.0.0.1/share/pkgs/redex> #<path:/Applications/Racket v6.0.0.1/share/pkgs/sandbox-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/scribble> #<path:/Applications/Racket v6.0.0.1/share/pkgs/seriali<br>
z!<br>
> e-cstruct-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/slideshow> #<path:/Applications/Racket v6.0.0.1/share/pkgs/snip> #<path:/Applications/Racket v6.0.0.1/share/pkgs/srfi> #<path:/Applications/Racket v6.0.0.1/share/pkgs/string-constants> #<path:/Applications/Racket v6.0.0.1/share/pkgs/syntax-color> #<path:/Applications/Racket v6.0.0.1/share/pkgs/typed-racket> #<path:/Applications/Racket v6.0.0.1/share/pkgs/typed-racket-more> #<path:/Applications/Racket v6.0.0.1/share/pkgs/unstable> #<path:/Applications/Racket v6.0.0.1/share/pkgs/unstable-contract-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/unstable-latent-contract-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/unstable-list-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/unstable-options-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/unstable-parameter-group-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/unstable-2d> #<path:/Applications/Racket v6.0.0.1/share/pkgs/web-server> #<pat<br>
h!<br>
> :/Applications/Racket v6.0.0.1/share/pkgs/wxme> #<path:/Applications/Ra!<br>
> cket v6.0.0.1/share/pkgs/xrepl> #<path:/Applications/Racket v6.0.0.1/share/pkgs/base> #<path:/Applications/Racket v6.0.0.1/share/pkgs/compatibility-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/drracket-plugin-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/errortrace-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/gui-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/parser-tools-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/string-constants-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/rackunit-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/scribble-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/scribble-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/compatibility-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/math-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/compiler-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/data-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/data-doc> #<path:/Application<br>
s!<br>
> /Racket v6.0.0.1/share/pkgs/db-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/db-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/scheme-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/srfi-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/wxme-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/gui-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/pict-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/pict-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/draw-x86_64-macosx> #<path:/Applications/Racket v6.0.0.1/share/pkgs/planet-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/snip-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/typed-racket-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/html-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/images-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/net-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/srfi-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/gui-pkg-manag<br>
e!<br>
> r-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/mzscheme-doc> #<!<br>
> path:/Applications/Racket v6.0.0.1/share/pkgs/net-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/planet-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/string-constants-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/errortrace-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/profile-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/r5rs-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/srfi-lite-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/htdp-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/htdp-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/html-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/images-gui-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/images-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/eli-tester> #<path:/Applications/Racket v6.0.0.1/share/pkgs/cext-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/math-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/mzscheme-lib> #<path:/Applications<br>
/!<br>
> Racket v6.0.0.1/share/pkgs/parser-tools-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/web-server-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/web-server-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/plot-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/plot-gui-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/plot-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/r5rs-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/r6rs-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/r6rs-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/rackunit-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/typed-racket-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/slideshow-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/distributed-places-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/distributed-places-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/rackunit-gui> #<path:/Applications/Racket v6.0.0.1/share/pkgs/rackunit-plugin-l<br>
i!<br>
> b> #<path:/Applications/Racket v6.0.0.1/share/pkgs/readline-lib> #<path!<br>
> :/Applications/Racket v6.0.0.1/share/pkgs/readline-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/redex-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/redex-examples> #<path:/Applications/Racket v6.0.0.1/share/pkgs/redex-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/redex-gui-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/slideshow-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/slideshow-exe> #<path:/Applications/Racket v6.0.0.1/share/pkgs/slideshow-plugin> #<path:/Applications/Racket v6.0.0.1/share/pkgs/syntax-color-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/syntax-color-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/unstable-flonum-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/xrepl-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/xrepl-doc> #<path:/Applications/Racket v6.0.0.1/share/pkgs/gui-x86_64-macosx> #<path:/Applications/Racket v6.0.0.1/share/pkgs/scribble-text-lib> #<path:/Applications/Racket v6.0.0.1/shar<br>
e!<br>
> /pkgs/math-x86_64-macosx> #<path:/Applications/Racket v6.0.0.1/share/pkgs/unstable-macro-testing-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/unstable-debug-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/unstable-pretty-lib> #<path:/Applications/Racket v6.0.0.1/share/pkgs/plot-compat> #<path:/Applications/Racket v6.0.0.1/share/pkgs/redex-pict-lib>)<br>
> raco pkg (show):<br>
> Installation-wide:<br>
> Package Checksum Source<br>
> main-distribution 009c289657b86ab25f320828841fa61a5425a257 (catalog main-distribution)<br>
> racket-lib 15de3807106727eeb46c7df35153b8ab29bd6f1f (catalog racket-lib)<br>
> [175 auto-installed packages not shown]<br>
> User-specific for installation "snapshot":<br>
> Package Checksum Source<br>
> zeromq e603d945685aa2bde34243ead5044bfc15dc563f (catalog zeromq)<br>
> zmq 10b634599296a142711138dab6b620db80f67738 (catalog zmq)<br>
> [1 auto-installed package not shown]<br>
><br>
><br>
><br>
> Collections:<br>
> ("/Users/erichanchrow/Library/Racket/snapshot/collects"<br>
> (non-existent-path))<br>
> ("/Applications/Racket v6.0.0.1/collects"<br>
> (".gitignore" "acks" "compiler" "data" "db" "dynext" "ffi" "file" "info" "info-domain" "json" "launcher" "net" "openssl" "pkg" "planet" "racket" "rackunit" "raco" "reader" "realm" "s-exp" "scheme" "setup" "srfi" "syntax" "unstable" "version" "xml"))<br>
><br>
> Recent Internal Errors:<br>
> Computer Language: (("Determine language from source") (#(#t print mixed-fraction-e #f #t debug) (default) #() "#lang racket\n" #t #t ((main) (test)) #t))<br>
><br>
</div></div></blockquote></div><br></div>