Making a Case: Rust for Python developers

Photo by Chris Ried on Unsplash

Woes of using Python…

Introducing Rust…

real    24m38.163s
user 0m0.335s //time couldn't capture the jvm process user stat
sys 0m0.088s
real    2m52.699s
user 2m34.125s
sys 0m12.078s

Surprising conciseness of Rust…

 agg //hashmap
.entry(id) //get the entry with key “id”
.or_insert(aggregate::new()) // if the entry is not present, then insert the empty structure
.topic_set //if the entry is present get the topic_set field from the aggregate structure
.insert(topic); //insert the topic to the topic_set
agg = dict()if id in agg:
agg[id][“topic_set”].add(topic)
else:
agg[id] = { “topic_set”: set(), “language_set”: set(), “primary_language”: None, “watchers_count”: 0 }
agg[id][“topic_set”].add(topic)

Is it worth it…

real    20m8.024s
user 0m0.304s
sys 0m0.051s
real 1m37.523s
user 4m11.576s
sys 0m9.232s

Note:

real    5m7.349s
user 4m17.373s
sys 0m4.444s
htop screen while running Rust code
htop screen while running Spark code

Final thoughts…

Deep Learning practitioner, Distributed Systems enthusiast and a newbie entrepreneur

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store