The document discusses parallelizing garbage collection (GC) in CRuby. Currently, CRuby's GC runs on a single core even in multi-core environments. Parallelizing GC would improve performance by utilizing multiple cores. The current GC algorithm uses mark-and-sweep, marking live objects reachable from roots in the mark phase and sweeping unmarked "dead" objects in the sweep phase. Parallelizing the marking phase could improve performance by distributing the work across multiple cores.
I will talk about some improvements of GC in Ruby 2.0.0. For instance, I will introduce about implementations of Bitmap Marking GC and so on, and show results of benchmarks after these are implemented.
Animation version is here: https://gumroad.com/l/xWCR (premium version)
I will talk about some improvements of GC in Ruby 2.0.0. For instance, I will introduce about implementations of Bitmap Marking GC and so on, and show results of benchmarks after these are implemented.
Animation version is here: https://gumroad.com/l/xWCR (premium version)
2018 Jul 25th LINE Developer Meetup #41 in Fukuoka
Session Slide in English / セッションスライドです。
Graal in GraalVM - A New JIT Compiler
オラクル社からGraalVMというものが発表され、話題を呼んでいます。GraalVMはHotSpot VM上に新しいJITコンパイラGraalと言語実装用フレームワーク/ASTインタプリタであるTruffle、さらにネイティブイメージ作成機能とその実行に使われるSubstrateVMを併せ持ったものです。すでにTruffleを使用したJavaScriptやRuby、R、Pythonの実装も提供されており、これらの言語とJavaはコードから相互に呼び出しができます。このセッションではGraalVMを概観したあと、JITコンパイラGraalにとくに注力して解説します。GraalとTruffleはOracle Labsとヨハネス・ケプラー大学で共同研究されており、多くの論文が発表されています。HotSpotのJITコンパイラとパフォーマンスや構造などを比較しつつ、GraalのJITコンパイルのテクニックについてもいくつか触れます。とにかく、私がGraalをとても好きなのです。デモも実施しつつ、Graalのすごさを伝えられればと考えています。
2018 Jul 25th LINE Developer Meetup #41 in Fukuoka
Session Slide in English / セッションスライドです。
Graal in GraalVM - A New JIT Compiler
オラクル社からGraalVMというものが発表され、話題を呼んでいます。GraalVMはHotSpot VM上に新しいJITコンパイラGraalと言語実装用フレームワーク/ASTインタプリタであるTruffle、さらにネイティブイメージ作成機能とその実行に使われるSubstrateVMを併せ持ったものです。すでにTruffleを使用したJavaScriptやRuby、R、Pythonの実装も提供されており、これらの言語とJavaはコードから相互に呼び出しができます。このセッションではGraalVMを概観したあと、JITコンパイラGraalにとくに注力して解説します。GraalとTruffleはOracle Labsとヨハネス・ケプラー大学で共同研究されており、多くの論文が発表されています。HotSpotのJITコンパイラとパフォーマンスや構造などを比較しつつ、GraalのJITコンパイルのテクニックについてもいくつか触れます。とにかく、私がGraalをとても好きなのです。デモも実施しつつ、Graalのすごさを伝えられればと考えています。
Slide Deck from our 2013 SANDCamp presentation. More of the content was likely captured in the conversation, as we used this deck as a jumping off point for the chat, but there's still some worthwhile concepts in there.
JRuby is Ruby for the JVM, right? But what does that really mean? What do you get out of the deal?
We'll explore what makes JRuby unique among Ruby implementations, and why the JVM is a Rubyist's dream come true. Using JRuby means you have the best GC, real threads, easy and scalable deployment, high performance, no-compile cross-platform libraries, and the best monitoring and profiling tools of any VM. And you get it all without leaving Ruby behind. If you're not using JRuby already, this talk will convince you to give it a try.
A 1 hour presentation of how GlassFish v3 Prelude provides support for Scripting / Dynamic Languages. Ruby/JRuby/Rails and Groovy/Grails are specifically described.
OSMC 2017 | Groovy There is a Docker in my Dashing Pipeline by Kris Buytaert NETWAYS
Dashing or rather Smashing is an awesome Monitoring Dashboard, but it’s a pita to deploy. This talk will document the efforts we went trough to make the deployment of both dashing and the dashboards fully automated. It also will show how we test these dashboards using docker and how we build these pipelines with the JenkinsDSL.
Whenever possible you should use this items.
All items shown are very important and not are a secret.
There are many ways of making the system work better and I'm not trying to reinvent the wheel.
You like it, it likes you!
JRuby on Rails - RoR's Simplicity Meets Java's Class (a case in point)Darshan Karandikar
Slides from my talk at RubyConf India 2012. This is a case in point for a highly productive & scalable enterprise application development platform with JRuby on Rails.
When we started to architect an enterprise micro-blogging solution as part of the internal collaboration platform for a large customer (henceforth referred by dummy name 'CustCollab'), the next immediate question was “Which web application development framework to use?”. Simplicity, productivity, ability to deliver high quality of service (QoS), especially performance & scalability, & alignment with CustCollab's technology stack were our top criteria for framework selection. After considerable research on state-of-the-art, we zeroed in on 2 frameworks – 1) “Ruby on Rails” (RoR) for its super simplicity & productivity & 2) “Java Enterprise Edition” (JEE) for its obvious “enterprise” class, high QoS & greater alignment with CustCollab's technology stack. But we just couldn't rule out either one, since each framework had been proven to deliver qualities not so proven in the other framework. Naturally, we started dreaming of a framework which can deliver best of both worlds! And in reality, there lived such a framework – 'JRuby on Rails'!
In this talk I will focus more on our experience of how JRuby, & hence JRoR, has done a fantastic job of delivering best of RoR & JEE worlds to an enterprise application w.r.t multiple 'quality of service' attributes like scalability (parallel processing, Garbage Collection, compilation, caching, advanced database connection pooling etc.), productivity, extensibility, security (especially CSRF), session management, reusability, total cost of ownership (alignment with existing/preferred technology stack) etc.
With the help of the real world 'CustCollab Micro-blogging' case in point, this presentation demonstrates how the distant, isolated worlds of RoR & JEE can synergize with the help of the JRuby bridge to result in a highly productive & scalable enterprise application development platform.
I hope it encourages others to adapt JRuby, & hence Ruby, in the enterprise. After all, as promised by the JRuby dev. team, the JRuby improvisation is well capable of delivering the best of both Java & Ruby worlds, & hence deserves greater attention in the enterprise world!
Groovy, to Infinity and Beyond - Groovy/Grails eXchange 2009Guillaume Laforge
Reviewing the Groovy 1.6 features, the new 1.7 functionalities, and a look into what the future holds for Groovy 1.8 and beyond!
Presentation given by Guillaume Laforge at the Groovy/Grails eXchange conference, in London.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
13. Ice-cream factory
✓ I worked in an assembly line
✓ For example, I made many
cardboard boxes.
✓ I was a professional cardboard box
maker :)
12/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
14. Ice-cream factory
✓ I made 150 boxes per hour
(ZOMG)
13/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
15. I was like a machine!!
http://www.flickr.com/photos/kevincollins123/5887984753/
16.
17.
18. Working with Java
✓ I worked in a big company.
✓ This work was similar to
assembly line work..
✓ I made a part of a product. I didn't
understand whole product.
17/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
19. I was still like a
machine!!
http://www.flickr.com/photos/kevincollins123/5887984753/
20.
21.
22. My current work
✓ Currently, I work at NaCl.
✓ Matz is my co-worker.
✓ Shugo maeda is my boss.
✓ They are CRuby committers.
21/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
25. In Ruby's works.
✓ Ruby's work wasn't similar to
assembly line work.
✓ I could make the whole product.
24/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
26. I was no longer
a machine!!
http://www.flickr.com/photos/danzden/121379782/
27.
28. Garbage Collection for me
✓ GC technology is very interesting
for me.
✓ GC is a garbage collecting
machine.
✓ I've been creating it since then.
It's very fun!!
27/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
38. My RDD history
✓ LazySweepGC - RubyKaigi2008
✓ LonglifeGC - 2009
✓ LazySweepGC - 2010
✓ ParallelMarkingGC - 2011
37/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
39. My RDD history
✓ LazySweepGC - RubyKaigi2008
✓ LonglifeGC - 2009
✓ LazySweepGC - 2010
✓ ParallelMarkingGC - 2011
38/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
40. LazySweepGC
✓ Traditional M&S GC executes
mark and sweep atomically.
✓ Ruby application stops during GC
(stop-the-world).
✓ In Lazy sweeping, sweeping is
lazy.
39/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
41. LazySweepGC
✓ Each invocation of the object
allocation sweeps Ruby's heap
✓ until it finds an appropriate free object.
40/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
42. Improvements
✓ This improves the response time
of GC
✓ I.e. the worst case time of GC
decreases.
41/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
43. LazySweepGC
✓ You can use LazySweepGC since
Ruby 1.9.3
42/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
44. My RDD history
✓ LazySweepGC - RubyKaigi2008
✓ LonglifeGC - 2009
✓ LazySweepGC - 2010
✓ ParallelMarkingGC - 2011
43/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
46. Today's topics
✓ Why do we need Parallel
Marking?
✓ What to consider?
✓ How to implement?
✓ How much did performance
improve?
45/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
47. Today's topics
✓ Why do we need Parallel
Marking?
✓ What to consider?
✓ How to implement?
✓ How much did performance
improve?
46/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
50. Current CRuby's GC
✓ GC operates on only 1 core.
✓ In multi-core environment, other
cores don't help GC.
49/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
51. GC:"I'm alone,
it's so hard."
http://www.flickr.com/photos/hortont/2698261070/
52. We should run GC in
parallel!!
http://www.flickr.com/photos/knallaerbse/2863161933/
54. What is GC?
✓ GC collects all dead objects.
53/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
55. What is a dead object?
✓ A dead object is an object that is
never referenced by the program.
✓ In GC terms, we say a that dead
object is unreachable from Roots.
54/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
56. What is Roots?
✓ Roots is a set of pointers that
directly reference objects in the
program.
✓ e.g. Ruby's local variables, etc..
55/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
57. For example
56/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
58. Please remember that
✓ GC collects objects that are
unreachable from Roots.
57/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
59. Next, Let me explain the
current CRuby GC
algorithm.
60. CRuby's GC algorithm
summary
✓ CRuby adopts the Mark & Sweep
algorithm
✓ Collector works in separate Mark
and Sweep phases.
59/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
61. In the Mark phase
✓ collector marks live objects that
are reachable from Roots.
60/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
62. For example
61/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
63. Mark phase with GC.start
62/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
64. Ruby Heap after marking
63/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
65. In the Sweep phase
✓ collector sweeps "dead" objects
✓ "dead" means unmarked
✓ "dead" means unreachable from Roots
64/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
66. Sweep phase
65/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
68. Characteristics
✓ The stop-the-world algorithm
✓ Single thread execution
67/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
69. Recently, PC has multi-core
processors. But,
✓ GC executes on a single thread.
✓ Other cores don't work during GC.
✓ What a waste!!
68/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
73. What is Parallel Marking?
✓ Collector run several marking
processes in parallel
✓ by using native threads.
✓ We will be happy on multi-core
machine.
72/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
74. Flow diagram for Parallel
Marking
73/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
75. Today's topics
✓ Why do we need Parallel
Marking?
✓ What to consider?
✓ How to implement?
✓ How much did performance
improve?
74/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
84. This means..
✓ Tasks are distributed to multiple
threads.
✓ The task of marking the entire
heap is divided into several tasks,
each marking a single branch.
83/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
99. What does "wait-free" mean?
✓ A wait-free program does non-
blocking execution.
✓ It guarantees per-thread progress.
98/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
102. Amdahl's law
is used to find the
maximum expected
improvement to an
overall system when
only part of the system
is improved.
[cited from `Amdahl's law - Wikipedia']
101/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
103. Amdahl's law is used in
parallel computing
✓ If parallel portion of the system is
X%
✓ And number of processors is Y,
✓ How much speedup can we
expect?
102/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
109. The conclusion so far
✓ We should consider how we can
efficiently balance workloads.
✓ So, we use Task Stealing.
✓ We should eliminate non-parallel
parts
✓ by using wait-free algorithm.
108/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
110. Today's topics
✓ Why do we need Parallel
Marking?
✓ What to consider?
✓ How to implement?
✓ How much did performance
improve
109/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
112. Task Stealing
✓ In Task Stealing, threads steal
tasks from each other
✓ Task Stealing is achieved with
Arora's Deque
111/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
113. Arora's Deque
✓ Deque stands for the Double-
Ended Queue.
✓ In Arora's Deque, the deque
contains tasks as elements.
✓ It's a wait-free data structure.
112/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
121. "Hey wait a minute,
doesn't shift() have
contention problems?"
122. In what ways could shift()
cause contention problems?
e.g...
✓ Multi-thread (workers) may call
shift() of same deque at the same
time.
121/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
123. In what ways could shift()
cause contention problems?
e.g...
✓ shift() and pop() could be called
at the same time
✓ when deque has only one element.
122/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
125. Serialization
✓ shift() is serialized by using CAS.
✓ CAS = Compare And Swap
✓ And, this serialization doesn't use
a lock.
✓ It's wait-free!!
124/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
126. I omit details of the
implementation of the
serialization.
127. For the sake of this
presentation, let's assume
that Arora's Deque avoids
contention problems.
128. Summary for Arora's Deque
✓ A simple data structure for Task
Stealing.
✓ Each worker has a single deque.
✓ Stealing (shift operation) is wait-
free!
127/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
129. How to use Arora's Deque
in Parallel Marking?
140. Summary
✓ Marker uses Arora's Deque as a
marking stack.
✓ A "task" means an object.
✓ The granularity of the task is very fine.
✓ This is a naive implementation.
139/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
147. Why slow?
✓ pop(),push(),shift() are called
frequently.
✓ Because deque has fine-grained tasks.
✓ Their overhead is too big.
146/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
155. Good point & Bad point
✓ Number of calls to Deque's
operations was reduced.
✓ Marking speed of the worker is
improved.
✓ However, Coarse-grained tasks
decrease parallelism.
154/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
158. If an object in B's branch has many child
objects..
159. .. then A can't steal it while B is marking
the large branch.
160. So, the worker needs to
treat large branches as
special cases.
161. Almost all large branches
hold large Array objects
and/or large Hash objects.
162. Treatment for large Array
objects and Hash objects
✓ Each marker has a special deque
to manage them.
✓ A marker divides them into fixed
size tasks.
✓ e.g. 0-9 elements of Array, 10-19
elements of Array...
161/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
163. Treatment for Large Array
and Hash
✓ By doing this, other workers can
steal divided tasks.
✓ This improves parallelism.
162/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
164. Summary
✓ The naive implementation was
slow.
✓ Grain of the task was too fine.
✓ A "task" means a branch in Roots
✓ Grain of the task is coarse.
✓ It's faster!!
163/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
165. Today's topics
✓ Why do we need Parallel
Marking?
✓ What to consider?
✓ How to implement?
✓ How much did performance
improve?
164/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
169. First benchmark program is
✓ make benchmark
✓ This is the benchmark which used in
CRuby development
168/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
170.
171. Why does this seem so slow?
✓ I think it's affected by Parallel
Marking's preparation.
✓ e.g. creating marking threads,
allocation of deques.
170/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
172. Why does this seem so slow?
✓ In most of the benchmarks, the
mark target objects are few.
✓ In this case, Parallel Marking cost is
expensive.
171/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
173. Next benchmark program is
✓ make rdoc
✓ make rdoc generates the Ruby
documentation.
✓ This benchmark measures execution
time and the GC execution time of
make rdoc.
172/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
174. make rdoc
✓ It takes about 80 seconds on my
machine.
✓ In fact, 30% of that time is spent
on GC!!
✓ How much did performance
improve?
173/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
178. In many core environment
✓ I expect we get a large
improvement.
✓ e.g. 8 core, 16 core...
✓ But, my machine has just 2 cores.
✓ I can't see it :(
177/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
179. Best case for Parallel GC
✓ If the objects are many.
✓ In this case, mark targets is also many.
✓ If the objects are long-lived.
✓ Server-side application?
178/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
181. Demonstration
✓ I want to show the performance
improvement with Parallel GC.
✓ This demonstration is video game
style.
180/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
187. Other characteristics of
SUPER NARIO GC
✓ GC is running in fixed intervals.
✓ A lot of objects are generated to
increase GC's burden.
✓ Burden = Game Level
186/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
188. Try to compare Original GC
and Parallel GC
✓ Original GC pause time is long.
✓ This game will be difficult.
✓ Parallel GC pause time is short.
✓ This game will be easy.
187/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
198. Windows OS is not supported
✓ Mark Worker uses pthread as
native thread.
✓ And, uses some gcc built-in
functions.
✓ But, I'll support for Windows
eventually.
197/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
199. Increased memory usage.
✓ Size of 1 Deque is roughly 32KB.
✓ But generally multi-core machine
have plenty of memory.
✓ So, I think it's OK :P
198/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
201. Conclusion
✓ I implemented Parallel Marking
GC
✓ GC was improved!
✓ I'll report to ruby-core soon.
200/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
202. Conclusion
✓ But, Parallel Marking has some
problems.
✓ I'll fix these.
201/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
203. source code
✓ Parallel Marking GC
✓ <URL:https://github.com/authorNari/
ruby/tree/pmark_div_root2>
✓ SUPER NARIO GC
✓ <URL:https://github.com/authorNari/
nario/>
202/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
204. Acknowledgments
✓ Following people helped me
make this presentation!!
✓ Tor-san!!
✓ matz, shugo, yhara, sada, takaokouji,
other co-workers!!
✓ Google Translate
203/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
205. R.I.P.
John McCarthy (Sep 4, 1927 – Oct 23,
2011)
204/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4
207. Do you have any
questions?
Please short and easy
questions :)
208. Sorry
✓ It's too difficult for me to
understand/answer the question.
✓ Could be send the question on
twitter(@nari_en)?
207/207
Parallel worlds of CRuby's GC Powered by Rabbit 1.0.4