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

Logger storage improvements #75

Merged
merged 8 commits into from
Jan 14, 2024
Merged

Logger storage improvements #75

merged 8 commits into from
Jan 14, 2024

Conversation

hkupty
Copy link
Owner

@hkupty hkupty commented Jan 13, 2024

No description provided.

There are quite a few changes packed here, so I'll try to summarize:

- Refactor the `ComponentNode` records into a simple `Node` class:

This is important because we unlock a simpler mutability (no need to
have atomic references), simpler creation (the only argument required is
the component) and we remove the redundant control over updates (atomic
references vs locks, in favour of locks).

- Replace char[][] structure with a simple String

Altough the original idea was to save memory by using char[][], it was
actually much worse as proven by a few tests, so instead we work with
strings natively.

- Drop cursors in favour of StringNavigator

The StringNavigator is an improvement over the Cursors as we can keep
the search code local to the functions that require it. For the
comparison of the components in a string we rely in the
`StringNavigator` and the `StringView` classes, which create much less
garbage. The `StringView` object just clips the original string by
adding an offset based on `.` and `$` positions in the base string.
Note that there's a caveat in the JMH tests: If we store the context,
the only actual test we'll be running is against a completely cached set
of values, so we need to recreate the storage at each test to ensure
we'll have a cance to test both creating new elements and fetching
cached elements.
@hkupty hkupty force-pushed the logger-storage-improvements branch from becde05 to 4a5afde Compare January 14, 2024 11:14
@hkupty hkupty merged commit a564c70 into dev/0.7 Jan 14, 2024
2 checks passed
@hkupty hkupty deleted the logger-storage-improvements branch March 20, 2024 18:55
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.

1 participant