镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Use simdjson::pad to pad strings to be parsed by simdjson #59389

Description

@joyeecheung

See joyeecheung#8 for a reference.

This might also be applicable to

node/src/node_modules.cc

Lines 116 to 120 in 50cfc6c

size_t json_length = package_config.raw_json.size();
package_config.raw_json.append(simdjson::SIMDJSON_PADDING, ' ');
simdjson::padded_string_view json_view(package_config.raw_json.data(),
json_length,
package_config.raw_json.size());

There is another place where we are manually padding the buffer, but I am not so sure whether using simdjson::pad is better than the current handling. I'd suggest first time contributors to avoid it unless you can assess the impact between the current approach and using simdjson::pad and find the latter to be preferrable.

if (!StringViewToUTF8(message,
&message_utf8,
&message_utf8_length,
simdjson::SIMDJSON_PADDING)) {

Activity

  1. added
    good first issueIssues that are suitable for first-time contributors.
    c++Issues and PRs that require attention from people who are familiar with C++.
    on Aug 7, 2025
  2. WebVishnu commented on Aug 11, 2025

    @WebVishnu

    @joyeecheung is this issue still open?

  3. added a commit that references this issue on Aug 17, 2025
  4. joyeecheung commented on Aug 18, 2025

    @joyeecheung
    MemberAuthor

    I guess only the one in src/inspector_profiler.cc remain now. I am not very sure if it's worth changing, however. So I guess it can be marked as completed.

  5. added a commit that references this issue on Aug 21, 2025
  6. added a commit that references this issue on Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++Issues and PRs that require attention from people who are familiar with C++.good first issueIssues that are suitable for first-time contributors.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions