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

Support benchmarking of resident compilation #39

Merged
merged 2 commits into from
Aug 30, 2017

Conversation

retronym
Copy link
Member

@retronym retronym commented Aug 25, 2017

Resident (aka, multi Run) compilation reuses a global, and its symbol table,
for subsequent compilation tasks.

Currently, this mode is only used in the presentation compiler and in the
REPL compiler.

This can lead to significant savings by avoiding re-parsing/-unpickling
class files. We'd expect this to matter more for small compile batches.

Corpus non-resident resident factor
vector 198ms 121 0.61
better-files 522 360 0.69
scalap 790 720 0.91

Resident compilation currently doesn't have a good for cache invalidation.
If a JAR or .class file is updated, it should throw away part of the symbol
table and re-read the classes.

The data we gather from these benchmarks will help motivate the effort to
add this cache invalidation.

It is also worth remembering that reducing the overhead of small compilation
batches is also useful for projects with large codebases. Zinc compiles small
sets of source files in an incremental compilation session.

val command = new CompilerCommand(line split "\\s+" toList, new Settings(scalacError))
compiler.reporter.reset()
new compiler.Run() compile command.files
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the resident method seems to be unused

@mkeskells
Copy link

mkeskells commented Aug 29, 2017

can we get a breakdown of the time and memory usage changes on a phase by phase basis, as we have the instrumentation to support this

@retronym
Copy link
Member Author

@mkeskells To integrate -Yprofile into the compiler-benchmark project we would need to extract the captured data programattcally at the conclusion of each compilation and aggregate it into an average across the entire benchmarking session.

One approach would be to use -YprofileDestination=tmpfile, and have a new JMH profiler that simply reads and parses that file. WDYT?

@retronym retronym merged commit 9db42ed into scala:master Aug 30, 2017
@mkeskells
Copy link

mkeskells commented Aug 30, 2017

@retronym the -YprofileDestination should work for that that, recording a run sequence no as one of the columns in the standard csv output. Could do a custom recorder but need to work out what to do with GC
It also recordsGC time to enable you to prune those phases from the aggregate - a 10ms average can be distorted by a 200ms GC pause.
@rorygraves is working on a front end integration with sbt that may also be of interest, allowing to 'run until stable', and looking to isolate the unstable timings - we thing sbt is doing some background tasks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants