Skip to content
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

Evaluate the performance of FFI #17

Open
jonnylin13 opened this issue Mar 31, 2021 · 0 comments
Open

Evaluate the performance of FFI #17

jonnylin13 opened this issue Mar 31, 2021 · 0 comments
Assignees
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@jonnylin13
Copy link
Owner

jonnylin13 commented Mar 31, 2021

It might make sense to pull some of the code out of Node.js and into a faster language like Rust, especially for the compute-heavy calls like AES encryption and WZ parsing (texture decompression). We need to evaluate the performance of the current implementation against a Rust implementation.

  • Implement Maple Shanda and AES in Rust
  • Add node bindings
  • Create a macro benchmark and run both of them with the same inputs (one in Node.js, one in Rust with FFI)
  • Report the results
  • Do the same for DXT decompression

If the overhead of FFI + running Rust code is far less costly than doing everything in Node.js, we should switch to this method.

Keep in mind this is probably only useful with DXT, because the native crypto module is probably already pretty fast. And it might also be worth it to just install node-dxt, or create another binding for libsquish if I can't get that to work

@jonnylin13 jonnylin13 added help wanted Extra attention is needed question Further information is requested labels Mar 31, 2021
@jonnylin13 jonnylin13 self-assigned this Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant