SlideShare a Scribd company logo
Increasing performance with Elixir
Tasks
Jeffrey Chan
Alembic
Twitter: @jgmchan
Github: https://github.com/jgmchan
Email: jgmchan@gmail.com
Background
✤ Client product - Places students into classes
✤ Algorithm time took > 4 minutes (sometimes 10)
✤ Sequential number crunching to work out best
solution
✤ Users were willing to wait but…
✤ Cloud service LB has a hard limit of 230s
Option 1
✤ Scale vertically
✤ Stronger CPU
✤ But already had the
largest CPU’s
Option 2
✤ Scale Horizontally
✤ Efficiently use more of
the CPU’s available
✤ Elixir Tasks
Option 3 (Bonus)
✤ Change the algorithm
✤ Actually the “real” correct solution
✤ Can’t get faster than not doing it
ElixirTask Module
✤ Module for spawning and awaiting tasks
✤ https://hexdocs.pm/elixir/Task.html
✤ Really easy to use (Erlang)
How they work
✤ Spawn separate Erlang processes to do work
✤ Wait for child process to send a message back with
result
✤ Processes are linked
How they work
✤ Single Process
✤ Input →⛏ → ⛏ → ⛏ → 💰
How they work
✤ With Tasks
✤ P1: Input →🤰 → ☕ → 😴 → 📞 →💰

⇣

P2: ⇢ 👶 →⛏ → ⇡

⇣

P3: ⇢ 👶 → ⛏→ ⇡

⇣

P4: ⇢ 👶 →⛏ → ⇡ 

Pre-requisites
✤ Tasks are short lived - usually isolated (no
communication)
✤ Pure functions are best
Demo!
Massive Performance Improvement
😎
Massive Performance Improvement
May as well use it everywhere
🤑 🤑 🤑
Massive Performance Improvement
Or is it?
A Better Demo
Limitations
✤ Number of CPU’s (can use multiple machines)
✤ BEAM overhead of switching tasks
Conclusion
✤ Task module can be very handy and easy to parallelise
your program
✤ Can use all the cores available in your machine (and
other machines)
✤ Not the answer to all problems
✤ Always measure!
Thanks!

More Related Content

PDF
DEV117 - Unleash the Power of the AppDev Pack and Node.js in Domino
PDF
YAPC::EU 2015 - Perl Conferences
PDF
Embracing the Future
PDF
ESNext, service workers, and the future of the web
PDF
Ways to measure & boost performance of your React app
PDF
Ways to measure & boost performance of your React app
PDF
Infinum Android Talks #05 - Square tape
PPTX
DEV117 - Unleash the Power of the AppDev Pack and Node.js in Domino
YAPC::EU 2015 - Perl Conferences
Embracing the Future
ESNext, service workers, and the future of the web
Ways to measure & boost performance of your React app
Ways to measure & boost performance of your React app
Infinum Android Talks #05 - Square tape

What's hot (20)

PDF
AWS Lambda Function with Kotlin
PDF
A Gentle Introduction to Functions-as-a-Service
PDF
The future of paas is serverless
PDF
JUST EAT: Tools we use to enable our culture
ODP
Synthetic web performance testing with Selenium
PPT
Performance with Selenium2
PPTX
Performance presentation
PDF
The dream BEAM - A former DevOps perspective
PDF
Azkaban-en
PDF
PPW2007 - Continuity Project
PDF
React + Mobile
PPTX
Untangling - fall2017 - week 9
PPTX
Serverless testing-serverless-sydney-20181018
PPTX
Untangling11
PPTX
Automation of Deep learning training with AWS Step Functions
PPTX
Untangling - fall2017 - week 10
PPTX
Better End-to-End Testing with Page Objects Model using Protractor
PDF
RubyConf Taiwan 2016 - Large scale Rails applications
PPTX
Async CTP 3 Presentation for MUGH 2012
AWS Lambda Function with Kotlin
A Gentle Introduction to Functions-as-a-Service
The future of paas is serverless
JUST EAT: Tools we use to enable our culture
Synthetic web performance testing with Selenium
Performance with Selenium2
Performance presentation
The dream BEAM - A former DevOps perspective
Azkaban-en
PPW2007 - Continuity Project
React + Mobile
Untangling - fall2017 - week 9
Serverless testing-serverless-sydney-20181018
Untangling11
Automation of Deep learning training with AWS Step Functions
Untangling - fall2017 - week 10
Better End-to-End Testing with Page Objects Model using Protractor
RubyConf Taiwan 2016 - Large scale Rails applications
Async CTP 3 Presentation for MUGH 2012
Ad

Similar to Increasing performance with Elixir Tasks (7)

PDF
Elixir – Peeking into Elixir's Processes, OTP and Supervisors
PPTX
Repeating History...On Purpose...with Elixir
PDF
Concurrency, Robustness & Elixir SoCraTes 2015
PDF
Elixir tutorial
PDF
Yurii Bodarev - OTP, Phoenix & Ecto: Three Pillars of Elixir
PPTX
PDF
Elixir and OTP Apps introduction
Elixir – Peeking into Elixir's Processes, OTP and Supervisors
Repeating History...On Purpose...with Elixir
Concurrency, Robustness & Elixir SoCraTes 2015
Elixir tutorial
Yurii Bodarev - OTP, Phoenix & Ecto: Three Pillars of Elixir
Elixir and OTP Apps introduction
Ad

Recently uploaded (20)

PPTX
L1 - Introduction to python Backend.pptx
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Online Work Permit System for Fast Permit Processing
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PPTX
ISO 45001 Occupational Health and Safety Management System
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
AI in Product Development-omnex systems
PDF
medical staffing services at VALiNTRY
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
PTS Company Brochure 2025 (1).pdf.......
L1 - Introduction to python Backend.pptx
Design an Analysis of Algorithms I-SECS-1021-03
Online Work Permit System for Fast Permit Processing
How Creative Agencies Leverage Project Management Software.pdf
Softaken Excel to vCard Converter Software.pdf
Odoo POS Development Services by CandidRoot Solutions
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
VVF-Customer-Presentation2025-Ver1.9.pptx
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Which alternative to Crystal Reports is best for small or large businesses.pdf
CHAPTER 2 - PM Management and IT Context
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
ISO 45001 Occupational Health and Safety Management System
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
AI in Product Development-omnex systems
medical staffing services at VALiNTRY
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PTS Company Brochure 2025 (1).pdf.......

Increasing performance with Elixir Tasks