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

Provide a flag to disable file hash check #111

Merged

Conversation

anton-fomin
Copy link
Contributor

https://github.com/gmethvin/directory-watcher does file hash check by default
to deduplicate change events. But that can increase the startup time on
large code base.

Fixes #110

https://github.com/gmethvin/directory-watcher does file hash check by default
to deduplicate change events. But that can increase the startup time on
large code base.
@lightbend-cla-validator

Hi @anton-fomin,

Thank you for your contribution! We really value the time you've taken to put this together.

Before we proceed with reviewing this pull request, please sign the Lightbend Contributors License Agreement:

https://www.lightbend.com/contribute/cla

@jtjeferreira
Copy link
Contributor

@raboof could you have a look?

@jtjeferreira
Copy link
Contributor

@mkurz since you are actively working on play issues and PRs, do you think you could help move this forward?

@mkurz
Copy link
Member

mkurz commented Feb 16, 2021

Do I understand correctly that the file hash check mechanism is only relevant when running an app with ~run mode?
So it can safely be turned off when just using run (when a page reload triggers re-compilation and reloading of the app)?

Copy link
Member

@mkurz mkurz left a comment

Choose a reason for hiding this comment

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

I think there is a mistake with the default.

src/main/scala/play/dev/filewatch/FileWatchService.scala Outdated Show resolved Hide resolved
@jtjeferreira
Copy link
Contributor

Do I understand correctly that the file hash check mechanism is only relevant when running an app with ~run mode?
So it can safely be turned off when just using run (when a page reload triggers re-compilation and reloading of the app)?

I think so, however this PR does not change anything, it will just allow play or users to change it without making a copy of DefaultFileWatchService and then setting PlayKeys.fileWatchService

In our work project changing this saved around 5s when starting the app. See also a flamegraph where we saved around 5s:

before:
image

after:
image

The purple is from searching "watch" which you can see is now reduced...

Co-authored-by: João Ferreira <jtjeferreira@gmail.com>
@mkurz
Copy link
Member

mkurz commented Feb 16, 2021

@jtjeferreira Curious, how large is your project? How many files? Sub-projects?

@jtjeferreira
Copy link
Contributor

@jtjeferreira Curious, how large is your project? How many files? Sub-projects?

around 6000 scala files, 60 sub projects

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

Successfully merging this pull request may close these issues.

Allow to disable hash check in DefaultFileWatcherService
4 participants