Skip to content
This repository has been archived by the owner on May 27, 2022. It is now read-only.

[Feature Request] Improved tracing algorithm in serde_reflection::trace_type #104

Open
ma2bd opened this issue Sep 27, 2021 · 0 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@ma2bd
Copy link
Contributor

ma2bd commented Sep 27, 2021

馃殌 Feature Request

serde_reflection::trace_type relies on a few ideas and heuristics that it might be time to revisit.

Notably, we use the current table of formats tracer.registry to guide the tracing in most decision points -- with the exception of tracer.incomplete_enums that is also used to decide how to trace enum variants.

This approach was a natural starting point but it is not ideal in the long run for a few reasons:

  • Calling trace_value before trace_type may update the registry in an incomplete way and defeat further tracing with trace_type.
  • We don't have an easy way to detect non-termination if the base case of enums is not the first variant.
  • We cannot call trace_type_once<T> repeatedly and hope to make progress in finding variants that are deeper that T. (For instance, after one tracing call on struct T(option<S>) we are not going to look into S ever again because it has a format: https://github.com/novifinancial/serde-reflection/blob/master/serde-reflection/src/de.rs#L199)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant