-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add -Vprofile option #15406
Add -Vprofile option #15406
Conversation
Add -Yprofile and -Yprofile-sorted-by option. This prints for each source file - the number of code lines - the number of tokens - the size of serialized tasty trees (just the trees, not the name table, nor the positions) - the complexity per line, computed by the formula (tasty-size/lines/50). That is, we assume a 50 tasy bytes/line as standard. Using -Yprofile-sorted-by one can sort by a column name.
Two questions:
|
Rename options to -V group Add -Vprofile-details option to print info about most complex methods.
Additionally, option |
The new format shows the Tasty size in terms of number of "chunks" where one chunk = 50 bytes. The threshold between low and moderate complexity is when chunk count and line count are the same. |
The
The columns are:
The The
The |
The previous comment is a first stab at docs for |
Well there's https://docs.scala-lang.org/overviews/compiler-options/index.html and then the various pages next to https://docs.scala-lang.org/scala3/guides/migration/options-new.html. Also, for options that take arguments, like -Wconf and -Xlint, there's a practice of adding some guidance under |
The closest would be to include |
I tried to add something about VProfile, but can't find that the markdown source of that file. Where is it? |
@dwijnand Thanks! I made a PR: scala/docs.scala-lang#2428 |
Current 2.13.8 example of verbose help is The help arg lists choices or text. Maybe this needs a forward port. There is a ticket to automate updating the doc page; a useful feature would be to also generate all the help texts, with a folding widget to hide them. I'll add that to the ticket, then see if that is also an easy forward port. People ask about the compiler options doc page often. It's nice to avoid multiple options clustering around a feature, as
with |
@som-snytt The problem here is that |
The boolean check is I don't mind trying out my suggestions as a follow-up, rather than setting in concrete here. I'm reminded that Lukas's optimizer blog got moved to its own docs page: https://docs.scala-lang.org/overviews/compiler-options/optimizer.html |
This option is not useful at all for profiling code that depend on |
Add
-Vprofile
and-Vprofile-sorted-by
options.This prints for each source file
assume 50 tasty-bytes/line as standard.
Using
-Vprofile-sorted-by
one can sort by a column name.