SlideShare une entreprise Scribd logo
1  sur  44
Télécharger pour lire hors ligne
Copyright © 2016 Russel Winder 1
Fast Python? Don’t Bother
Russel Winder
russel@winder.org.uk
https://www.russel.org.uk
@russel_winder
Copyright © 2016 Russel Winder 2
There is a rumour I only come to PyCon UK to
talk about languages other than Python…
Copyright © 2016 Russel Winder 3
…this is not true…
Copyright © 2016 Russel Winder 4
…well not entirely.
Copyright © 2016 Russel Winder 5
A gentle rant, but…
Copyright © 2016 Russel Winder 6
…a bit of a rant nonetheless.
Copyright © 2016 Russel Winder 7
Python is…
● A dynamically typed (or not) language.
● Quite popular, in data science, and data visualisation.
● Quite popular for sys. admin.
● Quite popular for Web-y stuff.
● Having it’s development driven by IDEs.
Type signatures.
Copyright © 2016 Russel Winder 8
Slow
Copyright © 2016 Russel Winder 9
Python is not…
● A high performance computational language.
● A language in which you can write parallel programs.
Copyright © 2016 Russel Winder 10
Copyright © 2016 Russel Winder 11
Maybe the GIL is a good thing,
it stops us using Python when we shouldn’t.
Copyright © 2016 Russel Winder 12
Why?
Copyright © 2016 Russel Winder 13
Parallelism
Copyright © 2016 Russel Winder 14
So how to do computation?
● Cython
● Numba
● NumPy
Copyright © 2016 Russel Winder 15
Cython
● Write Python and annotate the code to make it appear
like C so it is actually C by source-to-source translation.
Hats off to Pyrex.
Copyright © 2016 Russel Winder 16
Why not just write C if you want to write C?
Copyright © 2016 Russel Winder 17
Because C is a programming language for
writing operating systems, not applications?
Copyright © 2016 Russel Winder 18
What we want is Fortran or even FORTRAN.
Copyright © 2016 Russel Winder 19
Or not.
Copyright © 2016 Russel Winder 20
Numba
● Write Python code and decorate with decorator so as to
perform non-Python translation via LLVM to native code.
Copyright © 2016 Russel Winder 21
Does Python really have
native code semantics?
Copyright © 2016 Russel Winder 22
Does RPython really have
native code semantics?
Copyright © 2016 Russel Winder 23
No
Copyright © 2016 Russel Winder 24
NumPy
● And the whole SciPy, Pandas, etc. kit and caboodle.
● A C subsystem, providing opaque data types and
operations well integrated with Python as an API.
Copyright © 2016 Russel Winder 25
It’s just a C system with a nice API.
Lots of niceness to the API.
Copyright © 2016 Russel Winder 26
Is C good enough for computation
in the modern era?
Copyright © 2016 Russel Winder 27
No
Copyright © 2016 Russel Winder 28
Why?
Copyright © 2016 Russel Winder 29
Parallelism
Copyright © 2016 Russel Winder 30
Multi-multicore processors
GPGPU
Copyright © 2016 Russel Winder 31
OpenCL
Vulkan
CUDA
Copyright © 2016 Russel Winder 32
Actors
CSP
Dataflow
Data Parallelism
Copyright © 2016 Russel Winder 33
Parallel Processing
● Threads and thread pools:
– C – but very low level.
– C++ – better than C.
– Java: Akka, Quasar,
Hadoop, Apache Spark,
GPars.
– D – actors and data
parallelism.
● Partitioned Global
Address Space (PGAS):
– Chapel
– X10
There are man, many more:
Pony, Nim, etc.
Copyright © 2016 Russel Winder 34
Where does Python fit in?
Copyright © 2016 Russel Winder 35
It doesn’t for the computation…
Copyright © 2016 Russel Winder 36
…but there is a way forward:
Copyright © 2016 Russel Winder 37
Microservices Architecture
Copyright © 2016 Russel Winder 38
Processes communicating over a network.
Processes on same computer communicating using
inter-process communication.
Copyright © 2016 Russel Winder 39
Processes communicating is the only way pure Python
code can create parallelism so it must be Pythonic.
Copyright © 2016 Russel Winder 40
Intermix Python processes with non-Python ones.
Copyright © 2016 Russel Winder 41
Intermix:
● Python ● C
● C++
● Rust
● D
● Chapel
Copyright © 2016 Russel Winder 42
Peek at D and Chapel.
https://github.com/russel/Pi_Quadrature
Copyright © 2016 Russel Winder 43
Follow Up…
Short hands-on workshop:
Monday 2016-09-19T14:30+01:00
Room A
Copyright © 2016 Russel Winder 44
Fast Python? Don’t Bother
Russel Winder
russel@winder.org.uk
https://www.russel.org.uk
@russel_winder

Contenu connexe

Similaire à Fast Python? Don't Bother

Performance is not an Option - gRPC and Cassandra
Performance is not an Option - gRPC and CassandraPerformance is not an Option - gRPC and Cassandra
Performance is not an Option - gRPC and CassandraDave Bechberger
 
Python Intro For Managers
Python Intro For ManagersPython Intro For Managers
Python Intro For ManagersAtul Shridhar
 
Dear IT...I'd Like A Kubernetes Cluster
Dear IT...I'd Like A Kubernetes ClusterDear IT...I'd Like A Kubernetes Cluster
Dear IT...I'd Like A Kubernetes ClusterShannon Williams
 
Python for Data: Past, Present, Future (PyCon JP 2017 Keynote)
Python for Data: Past, Present, Future (PyCon JP 2017 Keynote)Python for Data: Past, Present, Future (PyCon JP 2017 Keynote)
Python for Data: Past, Present, Future (PyCon JP 2017 Keynote)Peter Wang
 
COMPUTER LANGUAGES AND THERE DIFFERENCE
COMPUTER LANGUAGES AND THERE DIFFERENCE COMPUTER LANGUAGES AND THERE DIFFERENCE
COMPUTER LANGUAGES AND THERE DIFFERENCE Pavan Kalyan
 
Python and R for quantitative finance
Python and R for quantitative financePython and R for quantitative finance
Python and R for quantitative financeLuca Sbardella
 
Python Games
Python GamesPython Games
Python GamesFahadAlH
 
Engineering the IoT at AWS - IOT402 - re:Invent 2017
Engineering the IoT at AWS - IOT402 - re:Invent 2017Engineering the IoT at AWS - IOT402 - re:Invent 2017
Engineering the IoT at AWS - IOT402 - re:Invent 2017Amazon Web Services
 
Using Approximate Data for Small, Insightful Analytics (Ben Kornmeier, Protec...
Using Approximate Data for Small, Insightful Analytics (Ben Kornmeier, Protec...Using Approximate Data for Small, Insightful Analytics (Ben Kornmeier, Protec...
Using Approximate Data for Small, Insightful Analytics (Ben Kornmeier, Protec...DataStax
 
The Datacenter Network You Wish You Had: It's yours for the taking.
The Datacenter Network You Wish You Had: It's yours for the taking.The Datacenter Network You Wish You Had: It's yours for the taking.
The Datacenter Network You Wish You Had: It's yours for the taking.All Things Open
 
The Datacenter Network You Wish You Had
The Datacenter Network You Wish You HadThe Datacenter Network You Wish You Had
The Datacenter Network You Wish You HadJeremy Schulman
 
BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...
BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...
BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...Michal Němec
 
Approaches to debugging mixed-language HPC apps
Approaches to debugging mixed-language HPC appsApproaches to debugging mixed-language HPC apps
Approaches to debugging mixed-language HPC appsRogue Wave Software
 
Why Python?
Why Python?Why Python?
Why Python?Adam Pah
 
Raspberry pi: Conceptos básicos de la arquitectura de la computadora raspberr...
Raspberry pi: Conceptos básicos de la arquitectura de la computadora raspberr...Raspberry pi: Conceptos básicos de la arquitectura de la computadora raspberr...
Raspberry pi: Conceptos básicos de la arquitectura de la computadora raspberr...SANTIAGO PABLO ALBERTO
 
Proglangauage1.10.18
Proglangauage1.10.18Proglangauage1.10.18
Proglangauage1.10.18Thinkful
 
Using the SDACK Architecture on Security Event Inspection by Yu-Lun Chen and ...
Using the SDACK Architecture on Security Event Inspection by Yu-Lun Chen and ...Using the SDACK Architecture on Security Event Inspection by Yu-Lun Chen and ...
Using the SDACK Architecture on Security Event Inspection by Yu-Lun Chen and ...Docker, Inc.
 
Introduction to Data Science & Python.pdf
Introduction to Data Science & Python.pdfIntroduction to Data Science & Python.pdf
Introduction to Data Science & Python.pdfAnshumanDwivedi14
 
An overview of data and web-application development with Python
An overview of data and web-application development with PythonAn overview of data and web-application development with Python
An overview of data and web-application development with PythonSivaranjan Goswami
 

Similaire à Fast Python? Don't Bother (20)

Performance is not an Option - gRPC and Cassandra
Performance is not an Option - gRPC and CassandraPerformance is not an Option - gRPC and Cassandra
Performance is not an Option - gRPC and Cassandra
 
Python Intro For Managers
Python Intro For ManagersPython Intro For Managers
Python Intro For Managers
 
Dear IT...I'd Like A Kubernetes Cluster
Dear IT...I'd Like A Kubernetes ClusterDear IT...I'd Like A Kubernetes Cluster
Dear IT...I'd Like A Kubernetes Cluster
 
Python for Data: Past, Present, Future (PyCon JP 2017 Keynote)
Python for Data: Past, Present, Future (PyCon JP 2017 Keynote)Python for Data: Past, Present, Future (PyCon JP 2017 Keynote)
Python for Data: Past, Present, Future (PyCon JP 2017 Keynote)
 
COMPUTER LANGUAGES AND THERE DIFFERENCE
COMPUTER LANGUAGES AND THERE DIFFERENCE COMPUTER LANGUAGES AND THERE DIFFERENCE
COMPUTER LANGUAGES AND THERE DIFFERENCE
 
Python and R for quantitative finance
Python and R for quantitative financePython and R for quantitative finance
Python and R for quantitative finance
 
Python Games
Python GamesPython Games
Python Games
 
Engineering the IoT at AWS - IOT402 - re:Invent 2017
Engineering the IoT at AWS - IOT402 - re:Invent 2017Engineering the IoT at AWS - IOT402 - re:Invent 2017
Engineering the IoT at AWS - IOT402 - re:Invent 2017
 
Using Approximate Data for Small, Insightful Analytics (Ben Kornmeier, Protec...
Using Approximate Data for Small, Insightful Analytics (Ben Kornmeier, Protec...Using Approximate Data for Small, Insightful Analytics (Ben Kornmeier, Protec...
Using Approximate Data for Small, Insightful Analytics (Ben Kornmeier, Protec...
 
The Datacenter Network You Wish You Had: It's yours for the taking.
The Datacenter Network You Wish You Had: It's yours for the taking.The Datacenter Network You Wish You Had: It's yours for the taking.
The Datacenter Network You Wish You Had: It's yours for the taking.
 
The Datacenter Network You Wish You Had
The Datacenter Network You Wish You HadThe Datacenter Network You Wish You Had
The Datacenter Network You Wish You Had
 
Why learn python in 2017?
Why learn python in 2017?Why learn python in 2017?
Why learn python in 2017?
 
BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...
BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...
BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...
 
Approaches to debugging mixed-language HPC apps
Approaches to debugging mixed-language HPC appsApproaches to debugging mixed-language HPC apps
Approaches to debugging mixed-language HPC apps
 
Why Python?
Why Python?Why Python?
Why Python?
 
Raspberry pi: Conceptos básicos de la arquitectura de la computadora raspberr...
Raspberry pi: Conceptos básicos de la arquitectura de la computadora raspberr...Raspberry pi: Conceptos básicos de la arquitectura de la computadora raspberr...
Raspberry pi: Conceptos básicos de la arquitectura de la computadora raspberr...
 
Proglangauage1.10.18
Proglangauage1.10.18Proglangauage1.10.18
Proglangauage1.10.18
 
Using the SDACK Architecture on Security Event Inspection by Yu-Lun Chen and ...
Using the SDACK Architecture on Security Event Inspection by Yu-Lun Chen and ...Using the SDACK Architecture on Security Event Inspection by Yu-Lun Chen and ...
Using the SDACK Architecture on Security Event Inspection by Yu-Lun Chen and ...
 
Introduction to Data Science & Python.pdf
Introduction to Data Science & Python.pdfIntroduction to Data Science & Python.pdf
Introduction to Data Science & Python.pdf
 
An overview of data and web-application development with Python
An overview of data and web-application development with PythonAn overview of data and web-application development with Python
An overview of data and web-application development with Python
 

Plus de Russel Winder

On Concurrency and Parallelism in the JVMverse
On Concurrency and Parallelism in the JVMverseOn Concurrency and Parallelism in the JVMverse
On Concurrency and Parallelism in the JVMverseRussel Winder
 
Making Python computations fast
Making Python computations fastMaking Python computations fast
Making Python computations fastRussel Winder
 
Tales from the Workshops
Tales from the WorkshopsTales from the Workshops
Tales from the WorkshopsRussel Winder
 
Java is Dead, Long Live Ceylon, Kotlin, etc
Java is Dead,  Long Live Ceylon, Kotlin, etcJava is Dead,  Long Live Ceylon, Kotlin, etc
Java is Dead, Long Live Ceylon, Kotlin, etcRussel Winder
 
Spocktacular testing
Spocktacular testingSpocktacular testing
Spocktacular testingRussel Winder
 
Spocktacular Testing
Spocktacular TestingSpocktacular Testing
Spocktacular TestingRussel Winder
 
Is Groovy static or dynamic
Is Groovy static or dynamicIs Groovy static or dynamic
Is Groovy static or dynamicRussel Winder
 
Dataflow: the concurrency/parallelism architecture you need
Dataflow: the concurrency/parallelism architecture you needDataflow: the concurrency/parallelism architecture you need
Dataflow: the concurrency/parallelism architecture you needRussel Winder
 
Are Go and D threats to Python
Are Go and D threats to PythonAre Go and D threats to Python
Are Go and D threats to PythonRussel Winder
 
Is Groovy as fast as Java
Is Groovy as fast as JavaIs Groovy as fast as Java
Is Groovy as fast as JavaRussel Winder
 
Who needs C++ when you have D and Go
Who needs C++ when you have D and GoWho needs C++ when you have D and Go
Who needs C++ when you have D and GoRussel Winder
 
Java 8: a New Beginning
Java 8: a New BeginningJava 8: a New Beginning
Java 8: a New BeginningRussel Winder
 
Why Go is an important programming language
Why Go is an important programming languageWhy Go is an important programming language
Why Go is an important programming languageRussel Winder
 
GPars: Groovy Parallelism for Java
GPars: Groovy Parallelism for JavaGPars: Groovy Parallelism for Java
GPars: Groovy Parallelism for JavaRussel Winder
 
GroovyFX: or how to program JavaFX easily
GroovyFX: or how to program JavaFX easily GroovyFX: or how to program JavaFX easily
GroovyFX: or how to program JavaFX easily Russel Winder
 
Switch to Python 3…now…immediately
Switch to Python 3…now…immediatelySwitch to Python 3…now…immediately
Switch to Python 3…now…immediatelyRussel Winder
 
Given Groovy Who Needs Java
Given Groovy Who Needs JavaGiven Groovy Who Needs Java
Given Groovy Who Needs JavaRussel Winder
 

Plus de Russel Winder (20)

On Concurrency and Parallelism in the JVMverse
On Concurrency and Parallelism in the JVMverseOn Concurrency and Parallelism in the JVMverse
On Concurrency and Parallelism in the JVMverse
 
Making Python computations fast
Making Python computations fastMaking Python computations fast
Making Python computations fast
 
Tales from the Workshops
Tales from the WorkshopsTales from the Workshops
Tales from the Workshops
 
Java is Dead, Long Live Ceylon, Kotlin, etc
Java is Dead,  Long Live Ceylon, Kotlin, etcJava is Dead,  Long Live Ceylon, Kotlin, etc
Java is Dead, Long Live Ceylon, Kotlin, etc
 
GPars Remoting
GPars RemotingGPars Remoting
GPars Remoting
 
GPars 2014
GPars 2014GPars 2014
GPars 2014
 
Spocktacular testing
Spocktacular testingSpocktacular testing
Spocktacular testing
 
Spocktacular Testing
Spocktacular TestingSpocktacular Testing
Spocktacular Testing
 
Is Groovy static or dynamic
Is Groovy static or dynamicIs Groovy static or dynamic
Is Groovy static or dynamic
 
Dataflow: the concurrency/parallelism architecture you need
Dataflow: the concurrency/parallelism architecture you needDataflow: the concurrency/parallelism architecture you need
Dataflow: the concurrency/parallelism architecture you need
 
Are Go and D threats to Python
Are Go and D threats to PythonAre Go and D threats to Python
Are Go and D threats to Python
 
Is Groovy as fast as Java
Is Groovy as fast as JavaIs Groovy as fast as Java
Is Groovy as fast as Java
 
Who needs C++ when you have D and Go
Who needs C++ when you have D and GoWho needs C++ when you have D and Go
Who needs C++ when you have D and Go
 
Java 8: a New Beginning
Java 8: a New BeginningJava 8: a New Beginning
Java 8: a New Beginning
 
Why Go is an important programming language
Why Go is an important programming languageWhy Go is an important programming language
Why Go is an important programming language
 
GPars: Groovy Parallelism for Java
GPars: Groovy Parallelism for JavaGPars: Groovy Parallelism for Java
GPars: Groovy Parallelism for Java
 
GroovyFX: or how to program JavaFX easily
GroovyFX: or how to program JavaFX easily GroovyFX: or how to program JavaFX easily
GroovyFX: or how to program JavaFX easily
 
Switch to Python 3…now…immediately
Switch to Python 3…now…immediatelySwitch to Python 3…now…immediately
Switch to Python 3…now…immediately
 
GPars Workshop
GPars WorkshopGPars Workshop
GPars Workshop
 
Given Groovy Who Needs Java
Given Groovy Who Needs JavaGiven Groovy Who Needs Java
Given Groovy Who Needs Java
 

Dernier

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 

Dernier (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 

Fast Python? Don't Bother

  • 1. Copyright © 2016 Russel Winder 1 Fast Python? Don’t Bother Russel Winder russel@winder.org.uk https://www.russel.org.uk @russel_winder
  • 2. Copyright © 2016 Russel Winder 2 There is a rumour I only come to PyCon UK to talk about languages other than Python…
  • 3. Copyright © 2016 Russel Winder 3 …this is not true…
  • 4. Copyright © 2016 Russel Winder 4 …well not entirely.
  • 5. Copyright © 2016 Russel Winder 5 A gentle rant, but…
  • 6. Copyright © 2016 Russel Winder 6 …a bit of a rant nonetheless.
  • 7. Copyright © 2016 Russel Winder 7 Python is… ● A dynamically typed (or not) language. ● Quite popular, in data science, and data visualisation. ● Quite popular for sys. admin. ● Quite popular for Web-y stuff. ● Having it’s development driven by IDEs. Type signatures.
  • 8. Copyright © 2016 Russel Winder 8 Slow
  • 9. Copyright © 2016 Russel Winder 9 Python is not… ● A high performance computational language. ● A language in which you can write parallel programs.
  • 10. Copyright © 2016 Russel Winder 10
  • 11. Copyright © 2016 Russel Winder 11 Maybe the GIL is a good thing, it stops us using Python when we shouldn’t.
  • 12. Copyright © 2016 Russel Winder 12 Why?
  • 13. Copyright © 2016 Russel Winder 13 Parallelism
  • 14. Copyright © 2016 Russel Winder 14 So how to do computation? ● Cython ● Numba ● NumPy
  • 15. Copyright © 2016 Russel Winder 15 Cython ● Write Python and annotate the code to make it appear like C so it is actually C by source-to-source translation. Hats off to Pyrex.
  • 16. Copyright © 2016 Russel Winder 16 Why not just write C if you want to write C?
  • 17. Copyright © 2016 Russel Winder 17 Because C is a programming language for writing operating systems, not applications?
  • 18. Copyright © 2016 Russel Winder 18 What we want is Fortran or even FORTRAN.
  • 19. Copyright © 2016 Russel Winder 19 Or not.
  • 20. Copyright © 2016 Russel Winder 20 Numba ● Write Python code and decorate with decorator so as to perform non-Python translation via LLVM to native code.
  • 21. Copyright © 2016 Russel Winder 21 Does Python really have native code semantics?
  • 22. Copyright © 2016 Russel Winder 22 Does RPython really have native code semantics?
  • 23. Copyright © 2016 Russel Winder 23 No
  • 24. Copyright © 2016 Russel Winder 24 NumPy ● And the whole SciPy, Pandas, etc. kit and caboodle. ● A C subsystem, providing opaque data types and operations well integrated with Python as an API.
  • 25. Copyright © 2016 Russel Winder 25 It’s just a C system with a nice API. Lots of niceness to the API.
  • 26. Copyright © 2016 Russel Winder 26 Is C good enough for computation in the modern era?
  • 27. Copyright © 2016 Russel Winder 27 No
  • 28. Copyright © 2016 Russel Winder 28 Why?
  • 29. Copyright © 2016 Russel Winder 29 Parallelism
  • 30. Copyright © 2016 Russel Winder 30 Multi-multicore processors GPGPU
  • 31. Copyright © 2016 Russel Winder 31 OpenCL Vulkan CUDA
  • 32. Copyright © 2016 Russel Winder 32 Actors CSP Dataflow Data Parallelism
  • 33. Copyright © 2016 Russel Winder 33 Parallel Processing ● Threads and thread pools: – C – but very low level. – C++ – better than C. – Java: Akka, Quasar, Hadoop, Apache Spark, GPars. – D – actors and data parallelism. ● Partitioned Global Address Space (PGAS): – Chapel – X10 There are man, many more: Pony, Nim, etc.
  • 34. Copyright © 2016 Russel Winder 34 Where does Python fit in?
  • 35. Copyright © 2016 Russel Winder 35 It doesn’t for the computation…
  • 36. Copyright © 2016 Russel Winder 36 …but there is a way forward:
  • 37. Copyright © 2016 Russel Winder 37 Microservices Architecture
  • 38. Copyright © 2016 Russel Winder 38 Processes communicating over a network. Processes on same computer communicating using inter-process communication.
  • 39. Copyright © 2016 Russel Winder 39 Processes communicating is the only way pure Python code can create parallelism so it must be Pythonic.
  • 40. Copyright © 2016 Russel Winder 40 Intermix Python processes with non-Python ones.
  • 41. Copyright © 2016 Russel Winder 41 Intermix: ● Python ● C ● C++ ● Rust ● D ● Chapel
  • 42. Copyright © 2016 Russel Winder 42 Peek at D and Chapel. https://github.com/russel/Pi_Quadrature
  • 43. Copyright © 2016 Russel Winder 43 Follow Up… Short hands-on workshop: Monday 2016-09-19T14:30+01:00 Room A
  • 44. Copyright © 2016 Russel Winder 44 Fast Python? Don’t Bother Russel Winder russel@winder.org.uk https://www.russel.org.uk @russel_winder