Skip to content

[C++] can we use simdjson to replace rapidjson #35460

Description

@wanweiqiangintel

Describe the enhancement requested

As the performance result mentioned in simdjson community: the simdjson library uses three-quarters less instructions than state-of-the-art parser RapidJSON. And the throughput of simdjson is much higher than that of rapidjson:
image

So can we replace rapidjson with simdjson to implement json parser?

Component(s)

C++

Activity

  1. kou commented on May 6, 2023

    @kou
    Member

    If simdjson is faster than RapidJSON for our use case too, I'm OK with this.

    Could you try this and share our benchmark result?
    https://github.com/apache/arrow/blob/main/cpp/src/arrow/json/parser_benchmark.cc

  2. lemire commented on May 12, 2023

    @lemire

    We are available to help.

    Note that simdjson is used by Apache Doris and ClickHouse.

  3. kou commented on May 12, 2023

    @kou
    Member

    Great!

  4. mapleFU commented on May 12, 2023

    @mapleFU
    Member

    Seems that writer can still use original logic, but parser can make full use of simdjson?

  5. kou commented on May 12, 2023

    @kou
    Member

    Is there any merit to use both RapidJSON and simdjson?

    I think that using either RapidJSON or simdjson will reduce our maintenance cost.

  6. changed the title [-]can we use simdjson to replace rapidjson[/-] [+][C++] can we use simdjson to replace rapidjson[/+] on May 15, 2023
  7. pitrou commented on May 24, 2023

    @pitrou
    Member

    Agreed with @kou , we probably want to avoid depending on two different JSON libraries.

    Interested people should try working on a PR.

  8. pitrou commented on May 24, 2023

    @pitrou
    Member

    I'm skeptical switching to simdjson would improve performance a lot, btw. Parsing is only a small part of the work necessary to convert JSON to Arrow.

  9. wgtmac commented on Apr 11, 2025

    @wgtmac
    Member

    I just want to revive this discussion again. #45459 will make RapidJson as a required dependency to parquet. However, RapidJson has been poorly maintained since 2016: Tencent/rapidjson#2321. It also seems to be a blocker to support CMake 4: #45985

  10. kou commented on Apr 11, 2025

    @kou
    Member

    Let's try simdjson for better maintainability!

  11. paleolimbot commented on Apr 11, 2025

    @paleolimbot
    Member

    For what it's worth, I think DuckDB uses yyjson, although I don't know if simdjson was considered. I seem to remember some past issues with homebrew packaging with respect to buildtime vs. runtime SIMD support (although I imagine simdjson has considered this as well!).

  12. lemire commented on Apr 11, 2025

    @lemire

    I seem to remember some past issues with homebrew packaging with respect to buildtime vs. runtime SIMD support (although I imagine simdjson has considered this as well!).

    The simdjson library uses runtime dispatching. It is currently used by Node.js, ClickHouse and other important systems. In turn, Node.js is part of several important systems.

    Optionally, we also support fancy C++20 features, and we will be integrating C++26 features (e.g., static reflection and the like) as soon as possible.

    Suggested reference:

    Documentation: https://github.com/simdjson/simdjson/blob/master/doc/basics.md

  13. pitrou commented on Apr 16, 2025

    @pitrou
    Member

    I agree we need to do something about our RapidJSON dependency. simdjson is a reasonable contender. We should just have to check it doesn't reduce the current platform compatibility (especially when SIMD isn't available/supported by simdjson).

  14. 64 remaining items

  15. rok commented on Aug 25, 2026

    @rok
    Member

    @Reranko05 on main we're getting this:

    /usr/bin/ld: /build/arrow-install/lib/libparquet.so.2600.0.0: undefined reference to `arrow::json::JsonWriter::String(std::basic_string_view<char, std::char_traits<char> >)'
    /usr/bin/ld: /build/arrow-install/lib/libparquet.so.2600.0.0: undefined reference to `arrow::json::JsonWriter::GetString() const'

    Is this something one of these issues will address or should we open a new one?

  16. pitrou commented on Aug 25, 2026

    @pitrou
    Member

    Is this something one of these issues will address or should we open a new one?

    There's a PR open at #50900 but I don't think it's a good solution - see comments.

    Edit: and it seems the corresponding issue is #50859

  17. Reranko05 commented on Aug 25, 2026

    @Reranko05
    Collaborator

    Is this something one of these issues will address or should we open a new one?

    @Krishnanand-G is working on the issue, we can try the approach suggested by @pitrou #50900 (comment)

  18. added a commit that references this issue on Aug 26, 2026
  19. added a commit that references this issue on Sep 21, 2026
  20. added a commit that references this issue on Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions