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

Fix ASN1 freezes and latency on big input #61

Merged
merged 5 commits into from
Mar 9, 2024

Conversation

TheBestTvarynka
Copy link
Owner

@TheBestTvarynka TheBestTvarynka commented Mar 9, 2024

closes #53

read commit messages for more details

It turned out that rendering absolute all bytes of the asn1 node is a
bad idea (ironically). It has caused big performance problems and latency.
Now we render only first `MAX_BYTES_TO_RENDER` / 2 and last `MAX_BYTES_TO_RENDER` / 2
bytes of the asn1 node if the overall amount of bytes is greater
than `MAX_BYTES_TO_RENDER`. Currently, `MAX_BYTES_TO_RENDER` is equal to `512`.
@TheBestTvarynka TheBestTvarynka added bug Something isn't working refactoring just refactoring. no any new features. asn1-parser Changes in the asn1-parser labels Mar 9, 2024
@TheBestTvarynka TheBestTvarynka self-assigned this Mar 9, 2024
cloning.

Previously, for every hex byte node, NodeOptions component, copy operation,
and so on, the app has cloned entire node bytes. This patch introduces
the `RcSlice` structure. This structure represents the slice with multiple
owners. But actually, it's just a `Vec` in the `Rc` plus range.

These changes affect the hex viewer and `NodeOptions` components the most.
We don't want to cause a big refactoring for now.

We have better performance and memory efficiency. `Vec`s cloning now is
not a bottleneck. But the noticeable freezes are still present.
and formatting hacks.

Reduced different conversions from `T` into `Classes` as much as possible.
It was unexpected, but a lot of `Classes` object constructions can cause
performance issues.

Replaced the `format!("{:02x?}", byte)` macro invocation with a simple
function with a big match that returns a static string.
@TheBestTvarynka TheBestTvarynka marked this pull request as ready for review March 9, 2024 22:56
Add one byte to the overall length. This byte represents
the 'Z' chat, that usuallu is placed in the end of the utc
time object.
Now the data will also be set in the input textarea during
loading from local storage.
@TheBestTvarynka TheBestTvarynka merged commit eaecf30 into main Mar 9, 2024
1 check passed
@TheBestTvarynka TheBestTvarynka deleted the fix/asn1-freezes-and-latency branch March 9, 2024 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
asn1-parser Changes in the asn1-parser bug Something isn't working refactoring just refactoring. no any new features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Asn1 page: freezes and big latency for large asn1 structures
1 participant