Skip to content

Support the PyEmscripten platform - #1083

Merged
ofek merged 2 commits into
mainfrom
ofek/pyemscripten
Jun 21, 2026
Merged

ofek merged 2 commits into
mainfrom
ofek/pyemscripten

Conversation

@ofek

@ofek ofek commented Jun 17, 2026 •

Copy link
Copy Markdown
Member

Resolves #1089

Notes

References

AI use

I collaborated with GPT-5.5 on Extra High for the following:

  • The initial scaffolding for the CI changes (which are mostly no longer present because I disliked the separate job approach).
  • The extension changes, primarily for understanding the root cause in order to simplify the logic and create informative code comments.
  • A loop to determine if lowering the recursion limit would remove the need to skip some tests but it didn't help for any of them.

@codspeed

codspeed Bot commented Jun 17, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 2.68%

⚡ 10 improved benchmarks
❌ 2 regressed benchmarks
✅ 127 untouched benchmarks
⏩ 135 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Simulation test_pickle_load[arm] 1.6 ms 1.8 ms -9.41%
❌ Simulation test_decode_type[arm-msgpack-False] 803.1 µs 840.5 µs -4.46%
⚡ Simulation test_decode_type[arm-msgpack-None] 748 µs 676.5 µs +10.57%
⚡ Simulation test_decode_type[arm-json-True] 938.5 µs 866.3 µs +8.34%
⚡ Simulation test_decode_type[arm-json-enum] 1.2 ms 1.1 ms +6.41%
⚡ Simulation test_decode_type[arm-msgpack-float] 2.2 ms 2.1 ms +4.31%
⚡ Simulation test_decode_type[arm-msgpack-int] 2.3 ms 2.2 ms +3.73%
⚡ Simulation test_decode_convert_type_non_strict[arm-msgpack-float] 2.2 ms 2.2 ms +3.43%
⚡ Simulation test_decode_type[arm-json-int] 2.6 ms 2.5 ms +3.07%
⚡ Simulation test_encode_type[arm-json-datetime] 1.7 ms 1.7 ms +2.95%
⚡ Simulation test_decode_convert_type_non_strict[arm-json-float] 3.2 ms 3.1 ms +2.47%
⚡ Simulation test_decode_type[arm-json-float] 3.2 ms 3.1 ms +2.3%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing ofek/pyemscripten (542a9a5) with main (551e2dc)

Open in CodSpeed

Footnotes

  1. 135 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@ofek
ofek force-pushed the ofek/pyemscripten branch 29 times, most recently from 320368f to 3dbb4e4 Compare June 18, 2026 00:08
@ofek
ofek force-pushed the ofek/pyemscripten branch 11 times, most recently from a5abc6b to 355f586 Compare June 18, 2026 15:48
@ofek
ofek marked this pull request as ready for review June 18, 2026 16:10
@ofek

ofek commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

@msgspec/committers This is ready for review! I was anticipating having to exclude these builds on PRs but they are actually now the fastest platform job. Should we wait to build 3.15?

Comment thread tests/unit/test_raw.py Resolved

@sobolevn sobolevn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great stuff! Thanks!

Comment thread src/msgspec/_core.c
return lk->table[index];
/* Compute the dense-table index in 64-bit space so large offsets
* cannot wrap through Py_ssize_t on 32-bit builds. */
if (key >= lk->offset) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Probably a bit paranoid, but this does kinda sit in a hot path, so I'd be curious to see the impact this has on pure int decoding when measured with #1087

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Let's merge that one first and then I'll rebase.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!

@ofek
ofek force-pushed the ofek/pyemscripten branch 4 times, most recently from f04018c to 37c8324 Compare June 21, 2026 05:34
@ofek
ofek force-pushed the ofek/pyemscripten branch from 37c8324 to 542a9a5 Compare June 21, 2026 16:07
@ofek

ofek commented Jun 21, 2026

Copy link
Copy Markdown
Member Author

@provinzkraut I rebased to trigger tests on the larger runners. Should we merge?

@provinzkraut

Copy link
Copy Markdown
Member

@provinzkraut I rebased to trigger tests on the larger runners. Should we merge?

I'm fine with it. The perf tests seem to be quite useless at the moment though, even with the macro-runners. I've re-opened CodSpeedHQ/codspeed#409 🤷

@ofek
ofek added this pull request to the merge queue Jun 21, 2026
Merged via the queue into main with commit 4d0ca3f Jun 21, 2026
25 of 26 checks passed
@ofek
ofek deleted the ofek/pyemscripten branch June 21, 2026 16:48
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.

Publish pyemscripten_* wheels

3 participants