Skip to content

std::variant performance issues #5

Closed
@vtyulb

Description

Hi, @jimporter!

Congrats on v1.0.0 release!

In this release you have added this note:
if Boost is installed, bencode.hpp will provide the ability to use [boost::variant](https://github.com/jimporter/bencode.hpp#boostvariant), which can perform significantly better than std::variant on some data sets (up to 2x faster than libstdc++ or libc++ when decoding integers)

Could you please clarify why you think that boost::variant outperforms std::variant?

I wrote simple benchmark to test it out: https://gist.github.com/vtyulb/6c0a7a553c3d9a6cdb74e1673b17f047
Benchmark shows no difference for a small bencode::dict encode & decode on amd ryzen 7 pro 4750u (archlinux / clang 15).

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions