Skip to content

Observations #389

@Kriskras99

Description

@Kriskras99

These are some observations I've made while reading through the documentation and the code. These are not things that necessarily need to be resolved, but I wanted to write them down as they are my impressions from reading through the codebase for the first time.

  • There are a bunch of public macros and constants that seem like they belong in the private API (likely!, unlikely!, static_cast_*!, stry!, SIMDINPUT_LENGTH, SIMDJSON_PADDING)
  • OwnedValue could just be BorrowedValue with something like the ownable traits to remove the lifetime when necessary. And for to_owned_value can just return a BorrowedValue<'static>.
  • Experiment with replacing beef::lean::Cow with HipStr, which inlines strings up to 23 bytes
  • Is there a variant of the APIs that accept a &str or String as input? Redoing the UTF-8 validation seems like a waste (but I haven't checked the performance impact)
  • The various re-exports make the docs quite confusing, especially pub use crate::value::* which hides everything it re-exports behind a *
    • It might be better to make the re-exported modules private, which makes the re-exported types and functions appear as if they are really in the root
  • Prelude docs say Prelude to include needed traits for every trait and module
  • Prelude includes modules, which kinda defeats the purpose of the prelude (this is actually an issue in value-trait)
  • Is the project still tracking simdjson v0.2? Because they are currently at v3.10
  • lib.rs is filled with massive functions that should probably be in their own module

If anything here is wrong or for a reason I don't know, please correct me!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions