Skip to content

Refactoring Database: const and faster loading, dropping bincode-loading #63

@bheylin

Description

@bheylin

At the moment the Database is quite a complex data structure.
I would like to make a single static database, but I'm not sure if that fit's with the design goals of the library.
So in an effort to clarify what the design goals of the library are, I have some questions:

  • Is there a concrete use case for loading a database that's not the default?
    The fn parse_with accepts a database param, is that used by the community?

    • If there is no concrete case, then maybe the Database can become a static structure represented as Rust source code
      generated from the assets/PhoneNumberMetadata.xml?
  • The bincode (Vec<Meatadata>) is processed on first use (through lazy_static at time of writing) into a Database which is a composite of a RegexCache and three HashMaps.
    This cache and HashMap generation has quite the runtime cost. It looks like it can be created offline and then stored as bincode. Then it's simply a matter of loading the database at runtime.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions