We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently, when a rule matches on a string, it allocates memory. In many formats the parent rule might fail and drop the allocated string.
An idea to optimize this is to push conversion operations instead of meta data, and then convert to meta data at the end of parsing.
The text was updated successfully, but these errors were encountered:
Tried the following structure:
/// Represents meta data. #[derive(PartialEq, Clone, Debug)] pub enum FastMetaData { /// Starts node. StartNode(Arc<String>), /// Ends node. EndNode(Arc<String>), /// Sets bool property. Bool(Arc<String>, bool), /// Sets f64 property. F64(Arc<String>, NumberSettings, DebugId), /// Sets string property. String(Arc<String>, StringFormat, DebugId), }
There is no point in using slices, because meta data are wrapped in Range<MetaData>. Arc<String> is cloned from meta rules.
Range<MetaData>
Arc<String>
This design seems to be a bit worse than the current one:
Before: test tests::bench_deep_string ... bench: 3,667,948 ns/iter (+/- 1,281,565) test tests::bench_hello ... bench: 54,625 ns/iter (+/- 25,679) After: test tests::bench_deep_string ... bench: 3,735,350 ns/iter (+/- 478,368) test tests::bench_hello ... bench: 58,666 ns/iter (+/- 13,847)
Sorry, something went wrong.
No branches or pull requests
Currently, when a rule matches on a string, it allocates memory. In many formats the parent rule might fail and drop the allocated string.
An idea to optimize this is to push conversion operations instead of meta data, and then convert to meta data at the end of parsing.
The text was updated successfully, but these errors were encountered: