Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Performance first: Node.js and Rust

Performance first: Node.js and Rust

Workshop about Performance techniques to use Rust with Node.js when Performance is necessary for a specific process or task.

Giovanny Gongora

June 11, 2018
Tweet

More Decks by Giovanny Gongora

Other Decks in Programming

Transcript

  1. What's Node.js for • Node is designed to build scalable

    network applications • Node is similar in design to, and influenced by, systems like Ruby's Event Machine or Python's Twisted • Just because Node is designed without threads, doesn't mean you cannot take advantage of multiple cores in your environment.
  2. Why Rust exists? • There is too little attention paid

    to safety • They have poor concurrency support • There is a lack of practical affordances • They offer limited control over resources
  3. How fast is Rust • Fast! Rust is already competitive

    with idiomatic C and C++ in a number of benchmarks • Rust takes zero-cost abstractions as one of its core principles: none of Rust’s abstractions impose a global performance penalty, nor is there overhead from any runtime system in the traditional sense.
  4. Goals for Rust • Design and Implement a safe, concurrent,

    practical systems language • Provides both efficient code and a comfortable level of abstraction
  5. Non Goals for Rust • We do not demand that

    Rust run on “every possible platform”. It must eventually work without unnecessary compromises on widely-used hardware and software platforms. • We do not intend to cover the complete feature-set of C++, or any other language. Rust should provide majority-case features. • We do not intend to be 100% static, 100% safe, 100% reflective, or too dogmatic in any other sense. Trade-offs exist.
  6. Advantages - Rust & Node.js • The performance increase is

    not the only advantage, the consolidation of processes simplifies the deployment strategy, troubleshooting and maintenance.
  7. Disadvantages - Rust & Node.js • Get a negligible gain

    in exchange for an implementation that doesn't scale • Sometimes writing a native module in Rust might not be easier, but would be the best answer for performance problems