Skip to content

Conversation

@SyMind
Copy link
Member

@SyMind SyMind commented Oct 20, 2025

This PR removes the RawSourceMap intermediary to parse source maps directly from simd_json BorrowedValue for performance, and updates constructors and serialization accordingly.

  • Replace RawSourceMap with direct parsing from &mut [u8] using simd_json::to_borrowed_value
  • Update SourceMap::from_json/from_slice/from_reader signatures and implementations
  • Switch serialization call (but introduced a potential misuse of simd_json::to_string)

Copilot AI review requested due to automatic review settings October 20, 2025 11:31
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the RawSourceMap intermediary to parse source maps directly from simd_json BorrowedValue for performance, and updates constructors and serialization accordingly.

  • Replace RawSourceMap + TryFrom with direct parsing from &mut [u8] using simd_json::to_borrowed_value
  • Update SourceMap::from_json/from_slice/from_reader signatures and implementations
  • Switch serialization call (but introduced a potential misuse of simd_json::to_string)

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/source.rs Removes RawSourceMap, adds direct JSON parsing using simd_json, updates constructors and serialization.
src/replace_source.rs Updates test to pass a mutable byte buffer to SourceMap::from_slice.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@SyMind SyMind force-pushed the refactor-simd-json branch from d896526 to 43bf168 Compare October 20, 2025 11:37
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 20, 2025

CodSpeed Performance Report

Merging #177 will improve performances by 37.78%

Comparing SyMind:refactor-simd-json (7ffc2c1) with main (d86a37a)

Summary

⚡ 1 improvement
✅ 8 untouched
⏩ 1 skipped1

Benchmarks breakdown

Benchmark BASE HEAD Change
parse_source_map_from_json 44.3 ms 32.2 ms +37.78%

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

@SyMind SyMind force-pushed the refactor-simd-json branch from 040a352 to fb30758 Compare October 21, 2025 03:05
@SyMind SyMind force-pushed the refactor-simd-json branch from 238e3f5 to 604f4c9 Compare October 21, 2025 03:59
@SyMind SyMind force-pushed the refactor-simd-json branch from 604f4c9 to 107624e Compare October 21, 2025 03:59
@SyMind SyMind force-pushed the refactor-simd-json branch from a401a18 to e82545d Compare October 21, 2025 05:29
@SyMind SyMind force-pushed the refactor-simd-json branch from 44298da to d5d631b Compare October 21, 2025 09:26
@SyMind SyMind force-pushed the refactor-simd-json branch 2 times, most recently from 28784f6 to 1cbefbd Compare October 21, 2025 09:54
@SyMind SyMind force-pushed the refactor-simd-json branch from 1cbefbd to d35ec0d Compare October 21, 2025 12:08
@SyMind SyMind force-pushed the refactor-simd-json branch from d35ec0d to 7ffc2c1 Compare October 22, 2025 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant