Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove println in sbt-plugin #41

Merged
merged 1 commit into from
Oct 30, 2023
Merged

Conversation

lolgab
Copy link
Contributor

@lolgab lolgab commented Oct 29, 2023

I'm seeing a lot of spammy printlns in 1.1.0-RC1 like:

ScopedKey(Scope(Select(ProjectRef(file:/Users/lorenzo/codacy/github/codacy-website/,legacy-api)), Select(ConfigKey(compile)), Zero, Zero),exportedProducts)
ScopedKey(Scope(Select(ProjectRef(file:/Users/lorenzo/codacy/github/codacy-website/,app)), Select(ConfigKey(compile)), Zero, Zero),internalDependencyClasspath)
ScopedKey(Scope(Select(ProjectRef(file:/Users/lorenzo/codacy/github/codacy-website/,app)), Select(ConfigKey(compile)), Zero, Zero),dependencyClasspath)
ScopedKey(Scope(Select(ProjectRef(file:/Users/lorenzo/codacy/github/codacy-website/,app)), Select(ConfigKey(compile)), Zero, Zero),dependencyVirtualClasspath)
ScopedKey(Scope(Select(ProjectRef(file:/Users/lorenzo/codacy/github/codacy-website/,app)), Select(ConfigKey(compile)), Zero, Zero),dependencyPicklePath)
ScopedKey(Scope(Select(ProjectRef(file:/Users/lorenzo/codacy/github/codacy-website/,app)), Select(ConfigKey(compile)), Zero, Zero),compileIncSetup)
ScopedKey(Scope(Select(ProjectRef(file:/Users/lorenzo/codacy/github/codacy-website/,app)), Select(ConfigKey(compile)), Select(compile), Zero),compileOptions)
ScopedKey(Scope(Select(ProjectRef(file:/Users/lorenzo/codacy/github/codacy-website/,app)), Select(ConfigKey(compile)), Zero, Zero),previousCompile)
ScopedKey(Scope(Select(ProjectRef(file:/Users/lorenzo/codacy/github/codacy-website/,app)), Select(ConfigKey(compile)), Select(compile), Zero),compileInputs)
[info] compiling 349 Scala sources and 16 Java sources to /Users/lorenzo/codacy/github/codacy-website/app/target/scala-2.13/classes ...
[info] Writing graph to /Users/lorenzo/codacy/github/codacy-website/app/target/scala-2.13/classes/META-INF/profiledb/graphs/implicit-searches-1698594885712.flamegraph
[info] Creating global statistics information at /Users/lorenzo/codacy/github/codacy-website/app/target/scala-2.13/classes/META-INF/profiledb/global.profiledb.
ScopedKey(Scope(Select(ProjectRef(file:/Users/lorenzo/codacy/github/codacy-website/,app)), Select(ConfigKey(compile)), Zero, Zero),compileIncremental)
ScopedKey(Scope(Select(ProjectRef(file:/Users/lorenzo/codacy/github/codacy-website/,app)), Select(ConfigKey(compile)), Zero, Zero),compileScalaBackend)
ScopedKey(Scope(Select(ProjectRef(file:/Users/lorenzo/codacy/github/codacy-website/,app)), Select(ConfigKey(compile)), Zero, Zero),compileSplit)
ScopedKey(Scope(Select(ProjectRef(file:/Users/lorenzo/codacy/github/codacy-website/,app)), Select(ConfigKey(compile)), Zero, Zero),manipulateBytecode)
ScopedKey(Scope(Select(ProjectRef(file:/Users/lorenzo/codacy/github/codacy-website/,app)), Select(ConfigKey(compile)), Zero, Zero),manipulateBytecode)
ScopedKey(Scope(Select(ProjectRef(file:/Users/lorenzo/codacy/github/codacy-website/,app)), Select(ConfigKey(compile)), Zero, Zero),compile)
ScopedKey(Scope(Select(ProjectRef(file:/Users/lorenzo/codacy/github/codacy-website/,app)), Select(ConfigKey(compile)), Zero, Zero),compile)
ScopedKey(Scope(Select(ProjectRef(file:/Users/lorenzo/codacy/github/codacy-website/,app)), Zero, Zero, Zero),compile)
ScopedKey(Scope(Select(ProjectRef(file:/Users/lorenzo/codacy/github/codacy-website/,app)), Select(ConfigKey(compile)), Zero, Zero),discoveredMainClasses)
ScopedKey(Scope(Select(ProjectRef(file:/Users/lorenzo/codacy/github/codacy-website/,app)), Select(ConfigKey(compile)), Zero, Zero),compileOutputs)
ScopedKey(Scope(Select(ProjectRef(file:/Users/lorenzo/codacy/github/codacy-website/,app)), Select(ConfigKey(compile)), Zero, Zero),compileOutputs)
ScopedKey(Scope(Select(ProjectRef(file:/Users/lorenzo/codacy/github/codacy-website/,app)), Select(ConfigKey(compile)), Select(compileOutputs), Zero),dynamicFileOutputs)

This PR removes them.

@sjrd sjrd merged commit 3097ff5 into scalacenter:main Oct 30, 2023
2 checks passed
@danicheg
Copy link
Collaborator

@lolgab any interesting observations/results?

@lolgab lolgab deleted the remove-println branch October 30, 2023 08:00
@lolgab
Copy link
Contributor Author

lolgab commented Oct 30, 2023

@danicheg Can you elaborate? I didn't understand about what results you are talking about.

@danicheg
Copy link
Collaborator

@lolgab It seems to me like you've tried out the scalac-profiling in the wild. So I'm asking you about some notable results of the investigation if you can share them.

@lolgab
Copy link
Contributor Author

lolgab commented Oct 30, 2023

@danicheg I gave a very quick try. I tried to generate a flamegraph but without success so far.
I will try again today :)
I think that the documentation needs some love. I have some experience with Scala and its tooling, but it was not easy to get started with async-profiler.
I think the best tool I used so far in this space is async-profiling. You run it, it runs for some time and generates directly an html file with your flamegraph, ready to be opened with a web browser. You can take some inspiration from it.

@danicheg
Copy link
Collaborator

I think that the documentation needs some love.

Yeah, agree.

I tried to generate a flamegraph but without success so far.

Don't know about the particular struggles you faced, but I recently wrote a short how-to for quick setup (it's not an ad).

I think the best tool I used so far in this space is async-profiling. You run it, it runs for some time and generates directly an html file with your flamegraph, ready to be opened with a web browser. You can take some inspiration from it.

Actually, I had ideas about wrapping needed stuff into the single command for scala-cli. Maybe will return to it sometime.

@lolgab
Copy link
Contributor Author

lolgab commented Oct 30, 2023

Thank you for the how-to! I'm going to follow it and let's see if I can make it work :)

@danicheg
Copy link
Collaborator

danicheg commented Oct 31, 2023

@lolgab have you tried building the scalac-profiling locally and using it? I just did it and got these errors in my sandbox project:

[error] bad option: -P:scalac-profiling:no-profiledb
[error] bad option: -P:scalac-profiling:show-profiles

If I use the 1.1.0-RC1 version with the same settings, it works well.
cc @sjrd

Sorry for bugging you, this was me 🤦🏻 We have to add some CONTRIBUTING.md guide too 😄

@danicheg danicheg added the sbt-scalac-profiling Relates to the SBT plugin label Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sbt-scalac-profiling Relates to the SBT plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants