Skip to content
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.

Avoid runtime universe init during startup #234

Closed

Conversation

dwijnand
Copy link
Member

Instead of initialising the scala reflection runtime universe the first
time a ManagedLogger is created (aka, at start up), let's kick that down
the line and use the cached LogExchange.stringTypeTagSuccessEvent for
def success.

Instead of initialising the scala reflection runtime universe the first
time a ManagedLogger is created (aka, at start up), let's kick that down
the line and use the cached LogExchange.stringTypeTagSuccessEvent for
`def success`.
@dwijnand
Copy link
Member Author

Spotted with async-profiler:
image

That's ManagedLogger creating the runtime universe during startup.

@eed3si9n
Copy link
Member

This came up in #153 and #221.
Do you have some before and after comparison number, like loading akka build and exiting several times?

@eed3si9n
Copy link
Member

Also note that the "develop" branch for util is now at sbt/sbt - https://github.com/sbt/sbt/blob/develop/internal/util-logging/src/main/scala/sbt/internal/util/ManagedLogger.scala

@dwijnand
Copy link
Member Author

Yeah, I saw. I'll move to sbt/sbt, which helps because I can build an sbt and give you an after number too.

@dwijnand dwijnand closed this Feb 29, 2020
@dwijnand dwijnand deleted the avoid-runtime-universe-initialisation branch February 29, 2020 07:38
@dwijnand
Copy link
Member Author

OK, in develop the runtime universe is warmed up in the ClassLoaderWarmup (on another thread). Even removing that it gets warmed up by TaskProgress sending a log message and needing a TypeTag for itself. So I stopped there.

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

Successfully merging this pull request may close these issues.

None yet

2 participants