Skip to content

Improve I/O performance by not writing placeholder files when they already exist #17873

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

Merged
merged 1 commit into from
Aug 10, 2021

Conversation

justinvelluppillai
Copy link
Contributor

fixes #17870

Description:

When matomo checks if directories are writeable it puts empty index files in the directories to prevent directory listing. This causes a few unnecessary writes. This fix checks if the file exists to potentially skip writing and reduce IO.

Note: We use is_file not file_exists as slightly faster: #16552

Review

  • Functional review done
  • Potential edge cases thought about (behavior of the code with strange input, with strange internal state or possible interactions with other Matomo subsystems)
  • Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
  • Security review done see checklist
  • Code review done
  • Tests were added if useful/possible
  • Reviewed for breaking changes
  • Developer changelog updated if needed
  • Documentation added if needed
  • Existing documentation updated if needed

@justinvelluppillai justinvelluppillai added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Aug 10, 2021
@justinvelluppillai justinvelluppillai added this to the 4.5.0 milestone Aug 10, 2021
@justinvelluppillai justinvelluppillai added the Needs Review PRs that need a code review label Aug 10, 2021
@diosmosis diosmosis merged commit 107a97b into 4.x-dev Aug 10, 2021
@diosmosis diosmosis deleted the 16552-file-exists-check branch August 10, 2021 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Development

Successfully merging this pull request may close these issues.

Improve I/O performance by not writing placeholder files when they already exist
2 participants