mirror of
https://github.com/mum4k/termdash.git
synced 2026-04-26 19:05:52 +03:00
[GH-ISSUE #293] Circular / Ring Buffer for Text Widget #146
Labels
No labels
bug
cleanup
enhancement
enhancement
enhancement
good first issue
help wanted
help wanted
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/termdash#146
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @timbutler on GitHub (Feb 12, 2021).
Original GitHub issue: https://github.com/mum4k/termdash/issues/293
Originally assigned to: @timbutler on GitHub.
I've started using this for a quick internal project, with one of features being log files monitored and displayed in real-time while other stats are displayed.
While this is working, one issue we've of course hit is when verbose logs are monitored that the size of the text buffer keeps increasing and of course leads to high memory usage and performance degradation.
A possible fix to this is to implement a simple ring buffer, where the Text
contenthas an (optional) maximum it can grow to. During theWritecall it could then pop content off the top of the buffer as required so that it never grows further than the maximum content.I've added this as a basic proof of concept internally, but wanted to confirm if this would be the best approach (or if I'm missing something obvious!) before submitting any pull request.
@mum4k commented on GitHub (Feb 12, 2021):
Hi @timbutler, you raise a good point about the memory usage when the
contentof theTextwidget just grows.Adding an optional circular buffer sounds like a great idea. Such PR would be a great addition to the
Textwidget, if you're willing to submit it. Please see CONTRIBUTING.md for additional instructions (e.g. which branch to fork from).Don't hesitate to let me know if you have any questions or would like to discuss the API change upfront.
@timbutler commented on GitHub (Feb 12, 2021):
Thanks for the rapid feedback @mum4k! I'll tidy my quick edits and submit a PR in the next few days for further feedback.
@mum4k commented on GitHub (Feb 12, 2021):
Sounds great, looking forward to it @timbutler.