Skip to content

Wrong constant used #275

@grisumbras

Description

@grisumbras

While working on boostorg/json#993 I noticed that JSON benchmark performance when using charconv::from_chars_erange has degraded since the original release (by ~8% for canada.json and ~6% for numbers.json). I've pinned down the degradation to 9b2e067. It seems that the reason is the log2 table, because I tried putting it in a cpp file and performance increased. Unfortunately, this couldn't be put in a PR, because the function using it is constexpr. Maybe you will find a solution.

Anyway, while looking at the commit, I noticed that this line looks wrong: https://github.com/boostorg/charconv/blob/develop/include/boost/charconv/detail/from_chars_integer_impl.hpp#L225. The value should presumably be std::numeric_limits<Integer>::digits. If I understand it correctly, this bug can also cause performance degradation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions