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

Bugfix/memory usage #16

Merged
merged 3 commits into from
Jun 26, 2024
Merged

Bugfix/memory usage #16

merged 3 commits into from
Jun 26, 2024

Conversation

luissimas
Copy link
Owner

@luissimas luissimas commented Jun 24, 2024

This PR aims to reduce the memory usage of the exporter.

Closes #15

@luissimas luissimas force-pushed the bugfix/memory-usage branch from 3fc236b to 452813a Compare June 24, 2024 12:03
@luissimas luissimas self-assigned this Jun 24, 2024
@luissimas luissimas marked this pull request as draft June 24, 2024 12:04
@luissimas luissimas added this to the v0.1.0 milestone Jun 24, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jun 24, 2024

Codecov Report

Attention: Patch coverage is 10.76923% with 58 lines in your changes missing coverage. Please review.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Files Coverage Δ
internal/collector/collector.go 55.10% <100.00%> (+0.93%) ⬆️
main.go 0.00% <0.00%> (ø)
internal/zettelkasten/git.go 7.40% <9.52%> (+7.40%) ⬆️

The current implementation of go-git has a high memory cost. Since our
needs are not that complex, we can use the default git CLI.

Reference:
go-git/go-git#315
@luissimas luissimas force-pushed the bugfix/memory-usage branch from e02ac18 to f10808c Compare June 25, 2024 12:45
@luissimas
Copy link
Owner Author

After replacing the go-git implementation with using the git CLI we can see a significant drop in memory usage. The exporter now uses approximately half the memory and its usage is much more stable. The cost of this is that now we have to install git on the final docker image, but since I've replaced the distroless debian base with alpine the final image size is now 37.1MB, a few megabytes smaller than before.

image

@luissimas luissimas marked this pull request as ready for review June 26, 2024 09:39
@luissimas luissimas merged commit c1bd544 into main Jun 26, 2024
5 checks passed
@luissimas luissimas deleted the bugfix/memory-usage branch June 26, 2024 09:41
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.

High memory usage
2 participants