Skip to content

Conversation

@zbraniecki
Copy link
Member

Builds upon #517 by switching our struct to store only symbols.

I'm not super attached to it, and I believe we'll want to store more than symbols, which I think should end up being a custom struct like:

struct DTFData<'d> {
    symbols: Cow<'d, DateSymbolsV1>,
    timezones: Cow<'d, TimezonesV1>,
    ...
}

struct DateTimeFormat {
    data: DTFDAta,
}

but for now I think it should do and fortunately refactoring this is trivial.

The main value of this is that we're avoiding storing all patterns we don't need but also, it allows us to just parse the pattern if needed and store just the parsed pattern.
This, on the other hands opens up possibility of storing borrowed strings in pattern, and zero-alloc parsing of patterns.

@zbraniecki zbraniecki requested a review from sffc March 3, 2021 04:08
@zbraniecki zbraniecki changed the title Dtf store symbols Store only symbols on DateTimeFormat Mar 3, 2021
@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • components/datetime/src/format.rs is different
  • components/datetime/src/lib.rs is different
  • components/datetime/src/provider/helpers.rs is no longer changed in the branch

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

Base automatically changed from master to main March 4, 2021 18:40
@sffc
Copy link
Member

sffc commented Mar 5, 2021

Good to reduce the data stored in DTF to the minimal set, and then grow from there.

@zbraniecki zbraniecki merged commit 2d6664a into unicode-org:main Mar 5, 2021
sffc added a commit that referenced this pull request Mar 16, 2021
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