Get the latest tech news

Using Rust to corrode insane Python run-times


There are times when adopting a standard approach just isn't good enough. This post is about making minimal changes for maximum effect where it matters.

Try breaking the data into chunks, and then using multi-processing (ugly in Python) to leverage a more powerful cloud virtual machine, sticking with matplotlib Avoid calling the library for every polygon, make one call per dataframe to reduce the library-call overhead massively Avoid heavyweight geometry libraries when the actual problem is very simple, the overhead hurts performance significantly Do bounding-box tests on every polygon Use integer-based math (faster than floating point), 32-bits where possible Use threads Upping the core count to 4 with code which is ultimately running in a Kubernetes cluster within AWS is perfectly reasonable when the goal here is a faster QA cycle.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Times

Times

Photo of Rust

Rust

Photo of insane Python

insane Python

Related news:

News photo

iFixit CEO Takes Shots At Anthropic For 'Hitting Our Servers a Million Times In 24 Hours'

News photo

Rust Is Ready With Robust Toolchain Handling For Linux 6.11

News photo

Rust doesn't solve the CrowdStrike outage