Skip to content

refactor(core): serialize response once, closes #5641#10641

Merged
lucasfernog merged 3 commits intodevfrom
refactor/ipc-json
Aug 15, 2024
Merged

refactor(core): serialize response once, closes #5641#10641
lucasfernog merged 3 commits intodevfrom
refactor/ipc-json

Conversation

@lucasfernog
Copy link
Member

This change impacts both the custom protocol and the postMessage based IPC implementations. Basically it changes the whole IPC mechanism to work on raw JSON strings so we do not need to serialize a serde_json::Value after serializing to it from a user-provided type.

i benchmarked this with a 150MB file response (returning Vec instead of tauri::ipc::Response since the latter does not serialize at all) and it went from 29s to 23s (custom protocol) and from 54s to 48s (post message) on macOS.

This change impacts both the custom protocol and the postMessage based IPC implementations. Basically it changes the whole IPC mechanism to work on raw JSON strings so we do not need to serialize a serde_json::Value after serializing to it from a user-provided type.

i benchmarked this with a 150MB file response (returning Vec<u8> instead of tauri::ipc::Response since the latter does not serialize at all) and it went from 29s to 23s (custom protocol) and from 54s to 48s (post message) on macOS.
@lucasfernog lucasfernog requested a review from a team as a code owner August 15, 2024 17:11
@github-actions
Copy link
Contributor

github-actions bot commented Aug 15, 2024

Package Changes Through 8b67a3b

There are 8 changes which include tauri-cli with prerelease, @tauri-apps/cli with prerelease, tauri-build with prepatch, tauri-codegen with prerelease, tauri-utils with prerelease, tauri-bundler with prerelease, tauri with prerelease, @tauri-apps/api with prepatch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
@tauri-apps/api 2.0.0-rc.0 2.0.1-rc.0
tauri-utils 2.0.0-rc.2 2.0.0-rc.3
tauri-bundler 2.0.1-rc.1 2.0.1-rc.2
tauri-runtime 2.0.0-rc.2 2.0.0-rc.3
tauri-runtime-wry 2.0.0-rc.2 2.0.0-rc.3
tauri-codegen 2.0.0-rc.2 2.0.0-rc.3
tauri-macros 2.0.0-rc.2 2.0.0-rc.3
tauri-plugin 2.0.0-rc.2 2.0.0-rc.3
tauri-build 2.0.0-rc.2 2.0.1-rc.0
tauri 2.0.0-rc.2 2.0.0-rc.3
@tauri-apps/cli 2.0.0-rc.3 2.0.0-rc.4
tauri-cli 2.0.0-rc.3 2.0.0-rc.4

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

amrbashir
amrbashir previously approved these changes Aug 15, 2024
@amrbashir
Copy link
Member

This a good improvement, nice job

@lucasfernog lucasfernog changed the title refactor(core): serialize response once closes #5641 refactor(core): serialize response once, closes #5641 Aug 15, 2024
@lucasfernog lucasfernog merged commit d0510f5 into dev Aug 15, 2024
@lucasfernog lucasfernog deleted the refactor/ipc-json branch August 15, 2024 19:15
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.

2 participants