Skip to content

der: auto read_nested in trait: DecodeValue::decode_value_nested #1916

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

dishmaker
Copy link
Contributor

@dishmaker dishmaker commented Jul 7, 2025

This PR is a step towards removing overhead of read_nested for primitive types, that was introduced in #1877.

I think reader.encoding_rules() should be generic, so BER read_nested would optimize out during compile time.

@tarcieri
Copy link
Member

tarcieri commented Jul 7, 2025

I'm not sure what the goal of this PR is. I think there's some potential merit to this statement, but it also seems unrelated to this PR:

I think reader.encoding_rules() should be generic, so BER optimizes out during compile time.

I played with that in der/ber-reader, however it does preclude runtime selection of DER vs BER. That said, I still think it's an option worth considering.

@dishmaker
Copy link
Contributor Author

The main goal is to optimize read_nested where it isn't necessary (e.g. primitive octet string).

But that probably wouldn't happen, because encoding_rules is a runtime value.

@dishmaker
Copy link
Contributor Author

Because this PR is premature optimization, I'll leave it for now.

@dishmaker dishmaker marked this pull request as ready for review July 8, 2025 11:07
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.

2 participants