SlideShare une entreprise Scribd logo
1  sur  39
Télécharger pour lire hors ligne
Improving the Rails
    ecosystem
   The Rubinius Virtual Machine




                1
Thanks EY!




    2
Be thinking of questions
a_better_ruby
     ==
a_better_rails
             # => true
Brand new code base
Write in ruby first.
       Then C if you have to.
If you’re not failing every now
and again, it’s a sign you’re not
doing anything very innovative.
                   Woody Allen
A work in progrees
Nov. 3: 1.0 preview
  End of 07: 1.0
You’re the customer
Help me help you.
Tell me your pain.
Some current pain
Memory usage


               Memory
• 1.8 garbage collector is simple, but too simple.
• Rubinius uses modern techniques to decrease
  memory usage and increase throughput




                                               Memory
                        15
The forking problem


                      Memory
In 1.8...

• Start up a mongrel.
• Require all your code.
• fork() the process.
• Watch your memory double.

                              Memory
                    17
In Rubinius...

• Start up a mongrel.
• Require all your code.
• fork() the process.
• Watch NO change in the memory footprint!

                                        Memory
                     18
Memory change per
          additional mongrel instance




1          2               3            4

    1.8                  rubinius
                 19
Packaging / Deployment
.rba == .jar
.rba == .war


                Packaging
• Precompiled code (.rbc)
• Meta data about project
  • RDoc
• Assets

                            Packaging
                      22
Performance
Built for change


                   Performance
Modern Techniques


• Inline caching
• Pre-compiled code
• JIT (eventually)

                           Performance
                      25
3 legged dog   turtles        space shuttle   rubinius
                                                Performance
                         26
Error reporting
Normal Backtraces

    An exception has occurred:
        User requested termination with Control-C (Interrupt)

    Backtrace:
            Readline.readline    at    kernel/core/readline.rb:52
               main.__script__   at    lib/bin/sirb.rb:78
                     main.load   at    kernel/core/compile.rb:78
                  main.require   at    kernel/core/compile.rb:129
                    Array#each   at    kernel/core/array.rb:526
        Integer(Fixnum)#times    at    kernel/core/integer.rb:19
                    Array#each   at    kernel/core/array.rb:526
                  main.require   at    kernel/core/compile.rb:112
                    Array#each   at    kernel/core/array.rb:526
        Integer(Fixnum)#times    at    kernel/core/integer.rb:19
                    Array#each   at    kernel/core/array.rb:526
                  main.require   at    kernel/core/compile.rb:111
               main.__script__   at    kernel/loader.rb:159
Reporting                             28
C extensions can
               misbehave


Reporting
VALUE test_segfault(VALUE self) {
                                // Get a pointer to address 4.
                                char *i = (char*)4;
                                // Attempt to read from address 4
                                // which is definitely not allowed.
                                x = *i;
                                // Never get this far.
                                return Qnil;
                              }

                       Raises an exception!
  Segfault detected in function 0x90a00 (accessing 0x4) (MemorySegmentionError)


   SomeExtension#test_segfault         at   extensions/test/test.c
               main.__script__         at   extensions/test/test.rb:38
                     main.load         at   kernel/core/compile.rb:95
               main.__script__         at   kernel/loader.rb:122



Reporting
Time lost to segfaults
                         (in minutes)


                   1.8                      rubinius
                                                           200
200


150


100
                                       70


 50       30

                                                           10
                                       6
          2


      1                            3                   5

                              31
Profiling
In 1.8...


• Profiling is instrumented only.
• The speed hit is prohibitive for running in
  production mode



                                                Profiling
                        33
In Rubinius...


• Sampling profiler available always
• Has little to no impact on performance


                                           Profiling
                      34
In my_app.rb
           require ‘simple_profile’

           profile(:profile1) do
             obj.run_slow_method
           end



shell# rbx profiler --analyze profile1.results


                                             Profiling
                        35
In environment.rb
      require ‘simple_profile’

      SimpleProfiler.profile_actions
      SimpleProfiler.profile_views



shell# rbx profiler --analyze actions.results
shell# rbx profiler --analyze views.results
                                                Profiling
                        36
Disclaimer
• All statements and numbers and opinions are
  only those of Evan Phoenix.

• All statistics are made up, but represent a
  general trend.




                        38
Evan Phoenix
    evan@fallingsnow.net
  ephoenix@engineyard.com




             39

Contenu connexe

Similaire à Rubinius - Improving the Rails ecosystem

Rocket Fuelled Cucumbers
Rocket Fuelled CucumbersRocket Fuelled Cucumbers
Rocket Fuelled CucumbersJoseph Wilk
 
Rails Hardware (no conclusions!)
Rails Hardware (no conclusions!)Rails Hardware (no conclusions!)
Rails Hardware (no conclusions!)yarry
 
Rails Application Optimization Techniques & Tools
Rails Application Optimization Techniques & ToolsRails Application Optimization Techniques & Tools
Rails Application Optimization Techniques & Toolsguest05c09d
 
Ansible for Configuration Management for Lohika DevOps training 2018 @ Lohika...
Ansible for Configuration Management for Lohika DevOps training 2018 @ Lohika...Ansible for Configuration Management for Lohika DevOps training 2018 @ Lohika...
Ansible for Configuration Management for Lohika DevOps training 2018 @ Lohika...Ihor Banadiga
 
Ceph Day Melbourne - Troubleshooting Ceph
Ceph Day Melbourne - Troubleshooting Ceph Ceph Day Melbourne - Troubleshooting Ceph
Ceph Day Melbourne - Troubleshooting Ceph Ceph Community
 
Some Rough Fibrous Material
Some Rough Fibrous MaterialSome Rough Fibrous Material
Some Rough Fibrous MaterialMurray Steele
 
JRuby 9000 - Taipei Ruby User's Group 2015
JRuby 9000 - Taipei Ruby User's Group 2015JRuby 9000 - Taipei Ruby User's Group 2015
JRuby 9000 - Taipei Ruby User's Group 2015Charles Nutter
 
Upgrading to Rails 3
Upgrading to Rails 3Upgrading to Rails 3
Upgrading to Rails 3juliangiuca
 
2011-03 Developing Windows Exploits
2011-03 Developing Windows Exploits 2011-03 Developing Windows Exploits
2011-03 Developing Windows Exploits Raleigh ISSA
 
Basics_of_Kernel_Panic_Hang_and_ Kdump.pdf
Basics_of_Kernel_Panic_Hang_and_ Kdump.pdfBasics_of_Kernel_Panic_Hang_and_ Kdump.pdf
Basics_of_Kernel_Panic_Hang_and_ Kdump.pdfstroganovboris
 
Kernel Recipes 2019 - BPF at Facebook
Kernel Recipes 2019 - BPF at FacebookKernel Recipes 2019 - BPF at Facebook
Kernel Recipes 2019 - BPF at FacebookAnne Nicolas
 
2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...
2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...
2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...chen yuki
 
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the CoreNSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the CoreNoSuchCon
 
introduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraformintroduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraformniyof97
 
C++ in kernel mode
C++ in kernel modeC++ in kernel mode
C++ in kernel modecorehard_by
 

Similaire à Rubinius - Improving the Rails ecosystem (20)

Rocket Fuelled Cucumbers
Rocket Fuelled CucumbersRocket Fuelled Cucumbers
Rocket Fuelled Cucumbers
 
Rails Hardware (no conclusions!)
Rails Hardware (no conclusions!)Rails Hardware (no conclusions!)
Rails Hardware (no conclusions!)
 
Rails Application Optimization Techniques & Tools
Rails Application Optimization Techniques & ToolsRails Application Optimization Techniques & Tools
Rails Application Optimization Techniques & Tools
 
Ansible for Configuration Management for Lohika DevOps training 2018 @ Lohika...
Ansible for Configuration Management for Lohika DevOps training 2018 @ Lohika...Ansible for Configuration Management for Lohika DevOps training 2018 @ Lohika...
Ansible for Configuration Management for Lohika DevOps training 2018 @ Lohika...
 
There and Back Again
There and Back AgainThere and Back Again
There and Back Again
 
Ceph Day Melbourne - Troubleshooting Ceph
Ceph Day Melbourne - Troubleshooting Ceph Ceph Day Melbourne - Troubleshooting Ceph
Ceph Day Melbourne - Troubleshooting Ceph
 
Some Rough Fibrous Material
Some Rough Fibrous MaterialSome Rough Fibrous Material
Some Rough Fibrous Material
 
JRuby 9000 - Taipei Ruby User's Group 2015
JRuby 9000 - Taipei Ruby User's Group 2015JRuby 9000 - Taipei Ruby User's Group 2015
JRuby 9000 - Taipei Ruby User's Group 2015
 
Valgrind
ValgrindValgrind
Valgrind
 
Scaling Django
Scaling DjangoScaling Django
Scaling Django
 
Redis ndc2013
Redis ndc2013Redis ndc2013
Redis ndc2013
 
Upgrading to Rails 3
Upgrading to Rails 3Upgrading to Rails 3
Upgrading to Rails 3
 
2011-03 Developing Windows Exploits
2011-03 Developing Windows Exploits 2011-03 Developing Windows Exploits
2011-03 Developing Windows Exploits
 
Basics_of_Kernel_Panic_Hang_and_ Kdump.pdf
Basics_of_Kernel_Panic_Hang_and_ Kdump.pdfBasics_of_Kernel_Panic_Hang_and_ Kdump.pdf
Basics_of_Kernel_Panic_Hang_and_ Kdump.pdf
 
Kernel Recipes 2019 - BPF at Facebook
Kernel Recipes 2019 - BPF at FacebookKernel Recipes 2019 - BPF at Facebook
Kernel Recipes 2019 - BPF at Facebook
 
2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...
2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...
2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...
 
Next Stop, Android
Next Stop, AndroidNext Stop, Android
Next Stop, Android
 
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the CoreNSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
 
introduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraformintroduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraform
 
C++ in kernel mode
C++ in kernel modeC++ in kernel mode
C++ in kernel mode
 

Plus de evanphx

Rubinius For You - GoRuCo
Rubinius For You - GoRuCoRubinius For You - GoRuCo
Rubinius For You - GoRuCoevanphx
 
Developing a Language
Developing a LanguageDeveloping a Language
Developing a Languageevanphx
 
Rubinius - What Have You Done For Me Lately?
Rubinius - What Have You Done For Me Lately?Rubinius - What Have You Done For Me Lately?
Rubinius - What Have You Done For Me Lately?evanphx
 
Rubinius - What Have You Done For Me Lately
Rubinius - What Have You Done For Me LatelyRubinius - What Have You Done For Me Lately
Rubinius - What Have You Done For Me Latelyevanphx
 
Staking Your Claim In Open Source
Staking Your Claim In Open SourceStaking Your Claim In Open Source
Staking Your Claim In Open Sourceevanphx
 
Rubinius 1.0 and more!
Rubinius 1.0 and more!Rubinius 1.0 and more!
Rubinius 1.0 and more!evanphx
 
RubyConf 2009
RubyConf 2009RubyConf 2009
RubyConf 2009evanphx
 
Accelerating Ruby with LLVM
Accelerating Ruby with LLVMAccelerating Ruby with LLVM
Accelerating Ruby with LLVMevanphx
 
Ruby World
Ruby WorldRuby World
Ruby Worldevanphx
 
Rubinius Community - MWRC
Rubinius Community - MWRCRubinius Community - MWRC
Rubinius Community - MWRCevanphx
 
rubyconf 2007 - Rubinius 1.0
rubyconf 2007 - Rubinius 1.0rubyconf 2007 - Rubinius 1.0
rubyconf 2007 - Rubinius 1.0evanphx
 
Rubinius - A Tool of the Future
Rubinius - A Tool of the FutureRubinius - A Tool of the Future
Rubinius - A Tool of the Futureevanphx
 

Plus de evanphx (12)

Rubinius For You - GoRuCo
Rubinius For You - GoRuCoRubinius For You - GoRuCo
Rubinius For You - GoRuCo
 
Developing a Language
Developing a LanguageDeveloping a Language
Developing a Language
 
Rubinius - What Have You Done For Me Lately?
Rubinius - What Have You Done For Me Lately?Rubinius - What Have You Done For Me Lately?
Rubinius - What Have You Done For Me Lately?
 
Rubinius - What Have You Done For Me Lately
Rubinius - What Have You Done For Me LatelyRubinius - What Have You Done For Me Lately
Rubinius - What Have You Done For Me Lately
 
Staking Your Claim In Open Source
Staking Your Claim In Open SourceStaking Your Claim In Open Source
Staking Your Claim In Open Source
 
Rubinius 1.0 and more!
Rubinius 1.0 and more!Rubinius 1.0 and more!
Rubinius 1.0 and more!
 
RubyConf 2009
RubyConf 2009RubyConf 2009
RubyConf 2009
 
Accelerating Ruby with LLVM
Accelerating Ruby with LLVMAccelerating Ruby with LLVM
Accelerating Ruby with LLVM
 
Ruby World
Ruby WorldRuby World
Ruby World
 
Rubinius Community - MWRC
Rubinius Community - MWRCRubinius Community - MWRC
Rubinius Community - MWRC
 
rubyconf 2007 - Rubinius 1.0
rubyconf 2007 - Rubinius 1.0rubyconf 2007 - Rubinius 1.0
rubyconf 2007 - Rubinius 1.0
 
Rubinius - A Tool of the Future
Rubinius - A Tool of the FutureRubinius - A Tool of the Future
Rubinius - A Tool of the Future
 

Dernier

Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...lizamodels9
 
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...Lviv Startup Club
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageMatteo Carbone
 
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Dave Litwiller
 
Cracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxCracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxWorkforce Group
 
RSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataRSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataExhibitors Data
 
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876dlhescort
 
Call Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine ServiceCall Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine Serviceritikaroy0888
 
Progress Report - Oracle Database Analyst Summit
Progress  Report - Oracle Database Analyst SummitProgress  Report - Oracle Database Analyst Summit
Progress Report - Oracle Database Analyst SummitHolger Mueller
 
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...anilsa9823
 
Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023Neil Kimberley
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Dipal Arora
 
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdfRenandantas16
 
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsValue Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsP&CO
 
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Delhi Call girls
 
The Coffee Bean & Tea Leaf(CBTL), Business strategy case study
The Coffee Bean & Tea Leaf(CBTL), Business strategy case studyThe Coffee Bean & Tea Leaf(CBTL), Business strategy case study
The Coffee Bean & Tea Leaf(CBTL), Business strategy case studyEthan lee
 
Regression analysis: Simple Linear Regression Multiple Linear Regression
Regression analysis:  Simple Linear Regression Multiple Linear RegressionRegression analysis:  Simple Linear Regression Multiple Linear Regression
Regression analysis: Simple Linear Regression Multiple Linear RegressionRavindra Nath Shukla
 
A305_A2_file_Batkhuu progress report.pdf
A305_A2_file_Batkhuu progress report.pdfA305_A2_file_Batkhuu progress report.pdf
A305_A2_file_Batkhuu progress report.pdftbatkhuu1
 
Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Roland Driesen
 
9599632723 Top Call Girls in Delhi at your Door Step Available 24x7 Delhi
9599632723 Top Call Girls in Delhi at your Door Step Available 24x7 Delhi9599632723 Top Call Girls in Delhi at your Door Step Available 24x7 Delhi
9599632723 Top Call Girls in Delhi at your Door Step Available 24x7 DelhiCall Girls in Delhi
 

Dernier (20)

Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
 
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
 
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
 
Cracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxCracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptx
 
RSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataRSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors Data
 
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
 
Call Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine ServiceCall Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine Service
 
Progress Report - Oracle Database Analyst Summit
Progress  Report - Oracle Database Analyst SummitProgress  Report - Oracle Database Analyst Summit
Progress Report - Oracle Database Analyst Summit
 
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
 
Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
 
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
 
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsValue Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and pains
 
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
 
The Coffee Bean & Tea Leaf(CBTL), Business strategy case study
The Coffee Bean & Tea Leaf(CBTL), Business strategy case studyThe Coffee Bean & Tea Leaf(CBTL), Business strategy case study
The Coffee Bean & Tea Leaf(CBTL), Business strategy case study
 
Regression analysis: Simple Linear Regression Multiple Linear Regression
Regression analysis:  Simple Linear Regression Multiple Linear RegressionRegression analysis:  Simple Linear Regression Multiple Linear Regression
Regression analysis: Simple Linear Regression Multiple Linear Regression
 
A305_A2_file_Batkhuu progress report.pdf
A305_A2_file_Batkhuu progress report.pdfA305_A2_file_Batkhuu progress report.pdf
A305_A2_file_Batkhuu progress report.pdf
 
Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...
 
9599632723 Top Call Girls in Delhi at your Door Step Available 24x7 Delhi
9599632723 Top Call Girls in Delhi at your Door Step Available 24x7 Delhi9599632723 Top Call Girls in Delhi at your Door Step Available 24x7 Delhi
9599632723 Top Call Girls in Delhi at your Door Step Available 24x7 Delhi
 

Rubinius - Improving the Rails ecosystem

  • 1. Improving the Rails ecosystem The Rubinius Virtual Machine 1
  • 3. Be thinking of questions
  • 4. a_better_ruby == a_better_rails # => true
  • 6. Write in ruby first. Then C if you have to.
  • 7. If you’re not failing every now and again, it’s a sign you’re not doing anything very innovative. Woody Allen
  • 8. A work in progrees
  • 9. Nov. 3: 1.0 preview End of 07: 1.0
  • 12. Tell me your pain.
  • 14. Memory usage Memory
  • 15. • 1.8 garbage collector is simple, but too simple. • Rubinius uses modern techniques to decrease memory usage and increase throughput Memory 15
  • 17. In 1.8... • Start up a mongrel. • Require all your code. • fork() the process. • Watch your memory double. Memory 17
  • 18. In Rubinius... • Start up a mongrel. • Require all your code. • fork() the process. • Watch NO change in the memory footprint! Memory 18
  • 19. Memory change per additional mongrel instance 1 2 3 4 1.8 rubinius 19
  • 21. .rba == .jar .rba == .war Packaging
  • 22. • Precompiled code (.rbc) • Meta data about project • RDoc • Assets Packaging 22
  • 24. Built for change Performance
  • 25. Modern Techniques • Inline caching • Pre-compiled code • JIT (eventually) Performance 25
  • 26. 3 legged dog turtles space shuttle rubinius Performance 26
  • 28. Normal Backtraces An exception has occurred: User requested termination with Control-C (Interrupt) Backtrace: Readline.readline at kernel/core/readline.rb:52 main.__script__ at lib/bin/sirb.rb:78 main.load at kernel/core/compile.rb:78 main.require at kernel/core/compile.rb:129 Array#each at kernel/core/array.rb:526 Integer(Fixnum)#times at kernel/core/integer.rb:19 Array#each at kernel/core/array.rb:526 main.require at kernel/core/compile.rb:112 Array#each at kernel/core/array.rb:526 Integer(Fixnum)#times at kernel/core/integer.rb:19 Array#each at kernel/core/array.rb:526 main.require at kernel/core/compile.rb:111 main.__script__ at kernel/loader.rb:159 Reporting 28
  • 29. C extensions can misbehave Reporting
  • 30. VALUE test_segfault(VALUE self) { // Get a pointer to address 4. char *i = (char*)4; // Attempt to read from address 4 // which is definitely not allowed. x = *i; // Never get this far. return Qnil; } Raises an exception! Segfault detected in function 0x90a00 (accessing 0x4) (MemorySegmentionError) SomeExtension#test_segfault at extensions/test/test.c main.__script__ at extensions/test/test.rb:38 main.load at kernel/core/compile.rb:95 main.__script__ at kernel/loader.rb:122 Reporting
  • 31. Time lost to segfaults (in minutes) 1.8 rubinius 200 200 150 100 70 50 30 10 6 2 1 3 5 31
  • 33. In 1.8... • Profiling is instrumented only. • The speed hit is prohibitive for running in production mode Profiling 33
  • 34. In Rubinius... • Sampling profiler available always • Has little to no impact on performance Profiling 34
  • 35. In my_app.rb require ‘simple_profile’ profile(:profile1) do obj.run_slow_method end shell# rbx profiler --analyze profile1.results Profiling 35
  • 36. In environment.rb require ‘simple_profile’ SimpleProfiler.profile_actions SimpleProfiler.profile_views shell# rbx profiler --analyze actions.results shell# rbx profiler --analyze views.results Profiling 36
  • 38. • All statements and numbers and opinions are only those of Evan Phoenix. • All statistics are made up, but represent a general trend. 38
  • 39. Evan Phoenix evan@fallingsnow.net ephoenix@engineyard.com 39