SlideShare uma empresa Scribd logo
1 de 98
[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object]
Well versed full stack
Architecture ,[object Object],[object Object]
Large whitelabel clients
Bursty traffic – Lady Gaga, EA, Gatorade etc.
 
[object Object]
[object Object]
[object Object]
[object Object],[object Object],[object Object]
Time
Event driven ,[object Object],[object Object]
Serialization / coercion (CPU)
VM – allocation, symbol tables etc. (CPU + mem)
Business requirements (CPU)
[object Object],Process 5856 detached % time  calls  syscall ------  ------- ------------- 89.69  5092  recvfrom 5.35  5093  sendto 2.49  26300  stat 2.05  11004  clock_gettime
[object Object],% time  calls  function ------  -------- -------- 95.78  635173  memcpy 1.38  25862  malloc 0.79  14984  free 0.60  11403  strcmp
[object Object],[object Object],[object Object]
Memory – local
Disk - local
Memory + disk - remote ,[object Object],[object Object]
Serialization + conversion (CPU)
Object instantiation (CPU + memory)
Optional memcached (local or remote memory)
[object Object]
[object Object],Benchmark.bm do |b| b.report do 1000.times{ ActiveRecord::Base.connection.select_rows "SELECT * FROM users" } end end user  system  total  real 0.300000  0.040000  0.340000 (  0.505095)
[object Object],Benchmark.bm do |b| b.report do 1000.times{ ActiveRecord::Base.connection.select_all "SELECT * FROM users" } end end user  system  total  real 0.510000  0.050000  0.560000 (  0.719201)
[object Object],Benchmark.bm do |b| b.report do 100_000.times{ 'string'.dup } end end user  system  total  real 0.040000  0.000000  0.040000 (  0.043791)
[object Object],Benchmark.bm do |b| b.report do 100_000.times{ Marshal.load(Marshal.dump('ruby string')) } end end user  system  total  real 1.660000  0.010000  1.670000 (  1.699882)
[object Object],[object Object],[object Object]
Opcodes / instructions
Dispatch
Optimizations ,[object Object],[object Object]
Garbage Collection
Contexts and control flow
Concurrency
[object Object]
 
[object Object],[object Object],[object Object]
Object model
Garbage Collection
No immediate performance gains for String manipulation etc. ,[object Object],[object Object]
Faster runtime
[object Object]
 
[object Object],[object Object],[object Object]
Annotations attach semantics to nodes
Possible to refactor the tree – more nodes, less complexity ,[object Object],[object Object]
Method calls, arguments and return values
Jumps – if, else, iterators
Unconditional jumps – exceptions, retry etc.
[object Object],[object Object],[object Object]
Reduces a tree to a linear and ordered instruction set
Fast execution – no tree walking + native code ,[object Object],[object Object]
Codegen, nodes -> instruction sequences
Postprocessing – replace with optimal instruction sequences (peephole optimization)
Pre and postprocessing phases may be multiple passes
[object Object]
 
[object Object],[object Object],[object Object]
Table defaults: 11 bins, 5 entries per bin
Bins++, sequential lookup inside bins
Lookup of methods, variables, encodings etc. ,[object Object],[object Object]
!(String || Symbol), points to a table entry
Developer identifies by name, VM by int
Immutable for performance – watch out for memory
[object Object]
[object Object],[object Object],[object Object]
Generated from definitions at interpreter compile time (existing ruby requirement for 1.9)
Instruction / opcode / operands notation ,[object Object],[object Object]
class / module: definition
method / iterator: invoke method, call block
Optimization: redefines common +, <<, * contracts
[object Object],[object Object],[object Object]
Move / copy values, top of stack -> elsewhere
SP: top of stack pointer, BP: bottom of stack pointer ,[object Object],[object Object]
Put strings “a”, “b” and “c” on the stack
Fetch top 3 stack elements
Create an array from them
[object Object],[object Object],[object Object]
Optimizing simple instructions is very important
Likely a small subset of the typical web app's hot path ,[object Object],[object Object]
Switch Dispatch : slower, but portable
[object Object]
[object Object],[object Object],[object Object]
Forth, Python 3
Not portable: GCC first class labels ,[object Object],[object Object]
Up to 50% slower than Threaded dispatch
Portable
[object Object],[object Object],[object Object]
Lazy invalidation – just bump the version ,[object Object],[object Object]
constant removal
method definition
method removal
method cache changes (covered later)
[object Object]
[object Object],[object Object],[object Object]

Mais conteúdo relacionado

Mais procurados

Assembler design options
Assembler design optionsAssembler design options
Assembler design options
Mohd Arif
 
Assembler design option
Assembler design optionAssembler design option
Assembler design option
Mohd Arif
 

Mais procurados (20)

Assembly Language Programming By Ytha Yu, Charles Marut Chap 8 (The Stack and...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 8 (The Stack and...Assembly Language Programming By Ytha Yu, Charles Marut Chap 8 (The Stack and...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 8 (The Stack and...
 
[ASM]Lab4
[ASM]Lab4[ASM]Lab4
[ASM]Lab4
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...
 
Alp 05
Alp 05Alp 05
Alp 05
 
C programming language tutorial
C programming language tutorial C programming language tutorial
C programming language tutorial
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Assembler design options
Assembler design optionsAssembler design options
Assembler design options
 
Assembler design option
Assembler design optionAssembler design option
Assembler design option
 
'C' language notes (a.p)
'C' language notes (a.p)'C' language notes (a.p)
'C' language notes (a.p)
 
C Programming Language Step by Step Part 1
C Programming Language Step by Step Part 1C Programming Language Step by Step Part 1
C Programming Language Step by Step Part 1
 
[ASM]Lab6
[ASM]Lab6[ASM]Lab6
[ASM]Lab6
 
C LANGUAGE - BESTECH SOLUTIONS
C LANGUAGE - BESTECH SOLUTIONSC LANGUAGE - BESTECH SOLUTIONS
C LANGUAGE - BESTECH SOLUTIONS
 
C programming session8
C programming  session8C programming  session8
C programming session8
 
Assembly Language Lecture 5
Assembly Language Lecture 5Assembly Language Lecture 5
Assembly Language Lecture 5
 
C programming session10
C programming  session10C programming  session10
C programming session10
 
C Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointC Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpoint
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
 
Unit 4 assembly language programming
Unit 4   assembly language programmingUnit 4   assembly language programming
Unit 4 assembly language programming
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
Assembly language 8086
Assembly language 8086Assembly language 8086
Assembly language 8086
 

Destaque (6)

Resume
ResumeResume
Resume
 
実践リーダブルコード - 課題の実装の進め方
実践リーダブルコード - 課題の実装の進め方実践リーダブルコード - 課題の実装の進め方
実践リーダブルコード - 課題の実装の進め方
 
Eterotopie Manageriali
Eterotopie ManagerialiEterotopie Manageriali
Eterotopie Manageriali
 
Publicidad Julio
Publicidad JulioPublicidad Julio
Publicidad Julio
 
Hermandad de la Plaza
Hermandad de la PlazaHermandad de la Plaza
Hermandad de la Plaza
 
Php Ppt
Php PptPhp Ppt
Php Ppt
 

Semelhante a RailswayCon 2010 - Dynamic Language VMs

NOSQL and Cassandra
NOSQL and CassandraNOSQL and Cassandra
NOSQL and Cassandra
rantav
 
tau 2015 spyrou fpga timing
tau 2015 spyrou fpga timingtau 2015 spyrou fpga timing
tau 2015 spyrou fpga timing
Tom Spyrou
 
Chapter Seven(2)
Chapter Seven(2)Chapter Seven(2)
Chapter Seven(2)
bolovv
 

Semelhante a RailswayCon 2010 - Dynamic Language VMs (20)

How it's made: C++ compilers (GCC)
How it's made: C++ compilers (GCC)How it's made: C++ compilers (GCC)
How it's made: C++ compilers (GCC)
 
Clojure concurrency
Clojure concurrencyClojure concurrency
Clojure concurrency
 
Domain Specific Languages In Scala Duse3
Domain Specific Languages In Scala Duse3Domain Specific Languages In Scala Duse3
Domain Specific Languages In Scala Duse3
 
NOSQL and Cassandra
NOSQL and CassandraNOSQL and Cassandra
NOSQL and Cassandra
 
Introduction to c_plus_plus
Introduction to c_plus_plusIntroduction to c_plus_plus
Introduction to c_plus_plus
 
Introduction to c_plus_plus (6)
Introduction to c_plus_plus (6)Introduction to c_plus_plus (6)
Introduction to c_plus_plus (6)
 
Ast transformation
Ast transformationAst transformation
Ast transformation
 
Otimizando Aplicações em Rails
Otimizando Aplicações em RailsOtimizando Aplicações em Rails
Otimizando Aplicações em Rails
 
tau 2015 spyrou fpga timing
tau 2015 spyrou fpga timingtau 2015 spyrou fpga timing
tau 2015 spyrou fpga timing
 
Compiler Construction | Lecture 12 | Virtual Machines
Compiler Construction | Lecture 12 | Virtual MachinesCompiler Construction | Lecture 12 | Virtual Machines
Compiler Construction | Lecture 12 | Virtual Machines
 
The Style of C++ 11
The Style of C++ 11The Style of C++ 11
The Style of C++ 11
 
Chapter Seven(2)
Chapter Seven(2)Chapter Seven(2)
Chapter Seven(2)
 
New features in Ruby 2.5
New features in Ruby 2.5New features in Ruby 2.5
New features in Ruby 2.5
 
Building a High-Performance Database with Scala, Akka, and Spark
Building a High-Performance Database with Scala, Akka, and SparkBuilding a High-Performance Database with Scala, Akka, and Spark
Building a High-Performance Database with Scala, Akka, and Spark
 
Advanced procedures in assembly language Full chapter ppt
Advanced procedures in assembly language Full chapter pptAdvanced procedures in assembly language Full chapter ppt
Advanced procedures in assembly language Full chapter ppt
 
Cassandra 2.1 boot camp, Overview
Cassandra 2.1 boot camp, OverviewCassandra 2.1 boot camp, Overview
Cassandra 2.1 boot camp, Overview
 
Profiling Ruby
Profiling RubyProfiling Ruby
Profiling Ruby
 
Summary of C++17 features
Summary of C++17 featuresSummary of C++17 features
Summary of C++17 features
 
apache-refcard-a4.pdf
apache-refcard-a4.pdfapache-refcard-a4.pdf
apache-refcard-a4.pdf
 
Let's talks about string operations in C++17
Let's talks about string operations in C++17Let's talks about string operations in C++17
Let's talks about string operations in C++17
 

Mais de Lourens Naudé

RailswayCon 2010 - Command Your Domain
RailswayCon 2010 - Command Your DomainRailswayCon 2010 - Command Your Domain
RailswayCon 2010 - Command Your Domain
Lourens Naudé
 

Mais de Lourens Naudé (9)

ZeroMQ as scriptable sockets
ZeroMQ as scriptable socketsZeroMQ as scriptable sockets
ZeroMQ as scriptable sockets
 
TX/RX 101: Transfer data efficiently
TX/RX 101: Transfer data efficientlyTX/RX 101: Transfer data efficiently
TX/RX 101: Transfer data efficiently
 
In the Loop - Lone Star Ruby Conference
In the Loop - Lone Star Ruby ConferenceIn the Loop - Lone Star Ruby Conference
In the Loop - Lone Star Ruby Conference
 
EuRuKo 2011 - In the Loop
EuRuKo 2011 - In the LoopEuRuKo 2011 - In the Loop
EuRuKo 2011 - In the Loop
 
Event Driven Architecture
Event Driven ArchitectureEvent Driven Architecture
Event Driven Architecture
 
RailswayCon 2010 - Command Your Domain
RailswayCon 2010 - Command Your DomainRailswayCon 2010 - Command Your Domain
RailswayCon 2010 - Command Your Domain
 
Barcamp PT
Barcamp PTBarcamp PT
Barcamp PT
 
Railswaycon Inside Matz Ruby
Railswaycon Inside Matz RubyRailswaycon Inside Matz Ruby
Railswaycon Inside Matz Ruby
 
Embracing Events
Embracing EventsEmbracing Events
Embracing Events
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
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...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

RailswayCon 2010 - Dynamic Language VMs