Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Use AsciiToString in Embind. NFC #24355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2025

Conversation

RReverser
Copy link
Collaborator

Embind had its own read readLatin1String, which is functionally identical to the AsciiToString helper we have in the shared libstrings library.

The only difference is that It had extra logic for caching characters by code, which are likely not even an optimisation in modern JIT engines, and if we do want to do that in the future for some reason, it's best to do so in centralised helpers.

For now, a simple search-replace gives an easy win in terms of code size.

@RReverser RReverser requested a review from sbc100 May 17, 2025 00:48
src/lib/libembind.js Show resolved Hide resolved
src/lib/libemval.js Show resolved Hide resolved
@RReverser RReverser force-pushed the embind-ascii-to-string branch from d03dc61 to a2a1612 Compare May 19, 2025 11:24
@RReverser
Copy link
Collaborator Author

The only concern I have (eternal with the way libraries are built in Emscripten) is whether readLatin1String is considered a public API that might be used by other users or an internal one.

Do we just need a changelog line to advise users if any to switch to the other function? Or do we need to preserve this name as an alias ~forever?

@sbc100
Copy link
Collaborator

sbc100 commented May 19, 2025

I'm fairly confident that we can consider this function internal only. @brendandahl WDYT?

Might be worth adding a changelog entry yes.

If we are concerned then its also trivial to add an alias using oldname: "newname", in the library library file.

Embind had its own read readLatin1String, which is functionally identical to the AsciiToString helper we have in the shared libstrings library.

The only difference is that It had extra logic for caching characters by code, which are likely not even an optimisation in modern JIT engines, and if we do want to do that in the future for some reason, it's best to do so in centralised helpers.

For now, a simple search-replace gives an easy win in terms of code size.
@RReverser RReverser force-pushed the embind-ascii-to-string branch from a2a1612 to 250f62c Compare May 19, 2025 21:16
@brendandahl
Copy link
Collaborator

I'd consider it internal and am fine with it going away.

@sbc100
Copy link
Collaborator

sbc100 commented May 19, 2025

OK, lets land as is. Enabling audo-merge.

@sbc100 sbc100 enabled auto-merge (squash) May 19, 2025 21:39
@RReverser
Copy link
Collaborator Author

@sbc100 I already restarted firefox CI, but it failed again. I see we don't configure EMTEST_RETRY_FLAKY for Firefox & Chrome CI tasks, only for core tests - we probably should?

@sbc100
Copy link
Collaborator

sbc100 commented May 19, 2025

@sbc100 I already restarted firefox CI, but it failed again. I see we don't configure EMTEST_RETRY_FLAKY for Firefox & Chrome CI tasks, only for core tests - we probably should?

Browser tests have (annoyingly) a different retry mechanism which applies to all tests. They are all retried on failure.

@sbc100 sbc100 disabled auto-merge May 19, 2025 23:19
@sbc100 sbc100 merged commit 6d0e4a8 into emscripten-core:main May 19, 2025
28 of 30 checks passed
@RReverser RReverser deleted the embind-ascii-to-string branch May 20, 2025 09:57
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.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.