Session + Live Q&A

Blazing Fast, Minimal Change - Speed Up Your Code by Refactoring to Rust

In order to improve the performance of existing applications and services, we can identify the most performance-critical pieces and reimplement them in Rust as opposed to completely rewriting the applications from scratch.

It’s tempting when we hear about a new technology or language to want to rewrite everything using that technology. Start over with a clean slate and fix all the problems of the old system. The new shiny system will surely be better than the last one! The constraints of reality often encroach on this fantasy as rewrite projects. They turn into seemingly never-ending projects due to bugs reemerging - bugs the old system contorted itself into to fix. In pursuit of improving performance, we can rewrite only those pieces of an application that are truly important to performance and use cross-language bindings in order to link existing code bases with code written in Rust.

In this talk, we will take an existing codebase and rewrite part of it in Rust. We will focus on:

  • Determining the feasibility of this type of refactor
  • Write a Rust reimplementation of existing behavior
  • Cross-language regression testing
  • Performance benchmarking of the new code

Main Takeaways

1 Hear about rewriting a portion of a code in Rust.

2 Learn how to identify the performance hotspots in a project, refactoring that piece of code in Rust, doing cross-language regression testing, and performing the benchmarks on the resulting code.


What is it you're working on today?

Today, I'm an engineering manager at OneSignal. I manage a team of six folks who write internal gRPC services and Kafka consumers in a mixture of Rust and Golang as depending on the performance needs and software needs of the project. The most exciting thing that we're working on right now is probably OneSignal's Journeys Project. Journeys Product, which just had its first public release a few weeks ago. It's an event driven system that allows our customers to use a very simple drag and drop interface to make very intricate, no code pipelines for how to message their client. So send this message wait X time. If they did click the message, send this other message. If they didn't click it, send that other message and it can get very large. And the whole thing is based on an event driven system that's maintained by my team.

What are your goals for this session?

In this session, I hope to educate people on how they can more easily speed up their existing monolithic software that's sitting out there, something like Python or Ruby. By adding in just a little sprinkling of Rust in the key places, and I hope to meet some interesting people in London.

And what would you like people to walk away with after they attend your session?

I would like people to walk away with an appreciation for how small a delta they can make in the code with how large of a performance benefit that could come out of it. It's really tempting to think like, Oh, we want this thing to be faster, we need to rewrite the entire world in Rust or Go or some new programming language, whatever. But I think the reality is, if you identify the hotspot you swap out the slowest code for the fastest code, then you can have a real difference with a small amount of effort.  


Speaker

Lily Mara

Engineering Manager @OneSignal

Lily Mara is an Engineering Manager at OneSignal in San Mateo, CA. She manages the Infrastructure Services team, which is responsible for in-house services used by other OneSignal engineering teams. Previously she was a software engineer at OneSignal, leading the efforts to create OneSignal's...

Read more

Date

Wednesday Apr 6 / 11:50AM BST (50 minutes)

Location

Mountbatten, 6th flr.

Track

WebAssembly & Modern Systems Programming Languages

Topics

Rust

Add to Calendar

Add to calendar

Share

From the same track

Session + Live Q&A

WebAssembly: Open to Interpretation

Wednesday Apr 6 / 04:10PM BST

Webassembly has been doing the rounds for a little while now. It's implemented in all major browsers, and we've seen several large, typically desktop-only apps use it to run on the web. Not to mention DOOM, of course.This makes Webassembly seem intimidating, surely there must be a lot to...

Rob Pilling

Lead Developer @Scott_Logic

Session + Live Q&A WebAssembly

What's Next for Rust and WebAssembly

Wednesday Apr 6 / 01:40PM BST

Most people have heard of Rust, due to the vibrant and happ[y community around the language, exemplified by it having held the top spot as the 'most loved' language in the Stack Overflow developer survey for the past six years. However, few of us get the chance to use this delightful...

Luca Palmieri

Principal Engineer @TrueLayer

William Overton

Senior Serverless Solutions Architect @Fastly

Lily Mara

Engineering Manager @OneSignal

Rob Pilling

Lead Developer @Scott_Logic

Session + Live Q&A Rust

There and Back Again: Our Rust Adoption Journey

Wednesday Apr 6 / 10:35AM BST

The introduction of a new programming language is a significant undertaking with long-term implications — a choice not to be taken lightly. TrueLayer's main business is not system programming, yet we decided to bet on Rust. Why? How?During the talk we will walk through our adoption...

Luca Palmieri

Principal Engineer @TrueLayer

Session + Live Q&A WebAssembly

Better Serverless Computing With WebAssembly

Wednesday Apr 6 / 02:55PM BST

About 10 years ago Fastly was founded with the goal of bringing developer's applications as close to users as possible.In this talk you'll see why WebAssembly is the next big step on our journey to computing at the edge. Learn about our edge computing platform, Compute@Edge, and upcoming...

William Overton

Senior Serverless Solutions Architect @Fastly

View full Schedule