Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Rust + WASM vs JS performance #169

@helabenkhalfallah

Description

@helabenkhalfallah

Summary

Hello, I want to use WASM in my frontend projects but comparing Rust + WASM performance vs JS, I always get JS more faster :

My project :
https://github.com/helabenkhalfallah/rust-react-wasm-js

I tried also many optimization flags combination, like :

[profile.release]
# This makes the compiled code faster and smaller, but it makes compiling slower,
# so it's only enabled in release mode.
lto = true

[profile.dev]
lto = true
opt-level = 3

Benchmarks :
1- Filter a big array to keep only numbers (4000 records)
2- Sort, map, filter a big array (about 10000 records)
3- Rust + reqwest vs JS + axios (download about 7800 records)

Benchmarks results :
image

WASM isn't suitable for these kinds of tasks (usual website tasks) ? If yes where WASM + Rust shine (I'm confused about when to use?)
Else is there others suggestions for optimization ?

Thanks :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions