The document discusses an NES emulator written in Ruby called Optcarrot. It aims to achieve 60 fps in Ruby 3.0 to drive optimization of the Ruby interpreter. The emulator currently runs at 20 fps in Ruby 2.0. It then details how the emulator achieves 20 fps through techniques like emulating the CPU and GPU in parallel and pre-rendering screens. Benchmark results are shown for different Ruby implementations, with JRuby 9k the fastest. Various "ProTips" are discussed to further optimize the emulator towards 60 fps through techniques like method inlining and replacing instance variables with locals.
Unite Berlin 2018 - Book of the Dead Optimizing Performance for High End Cons...Unity Technologies
In this session, the Unity Demo team provides their best tips and tricks for optimizing detailed, complex environment scenes for modern console performance.
Speakers:
Rob Thompson (Unity Technologies)
Running Applications on the NetBSD Rump Kernel by Justin Cormack eurobsdcon
Abstract
The NetBSD rump kernel has been developed for some years now, allowing NetBSD kernel drivers to be used unmodified in many environments, for example as userspace code. However it is only since last year that it has become possible to easily run unmodified applications on the rump kernel, initially with the rump kernel on Xen port, and then with the rumprun tools to run them in userspace on Linux, FreeBSD and NetBSD. This talk will look at how this is achieved, and look at use cases, including kernel driver development, and lightweight process virtualization.
Speaker bio
Justin Cormack has been a Unix user, developer and sysadmin since the early 1990s. He is based in London and works on open source cloud applications, Lua, and the NetBSD rump kernel project. He has been a NetBSD developer since early 2014.
Unite Berlin 2018 - Book of the Dead Optimizing Performance for High End Cons...Unity Technologies
In this session, the Unity Demo team provides their best tips and tricks for optimizing detailed, complex environment scenes for modern console performance.
Speakers:
Rob Thompson (Unity Technologies)
Running Applications on the NetBSD Rump Kernel by Justin Cormack eurobsdcon
Abstract
The NetBSD rump kernel has been developed for some years now, allowing NetBSD kernel drivers to be used unmodified in many environments, for example as userspace code. However it is only since last year that it has become possible to easily run unmodified applications on the rump kernel, initially with the rump kernel on Xen port, and then with the rumprun tools to run them in userspace on Linux, FreeBSD and NetBSD. This talk will look at how this is achieved, and look at use cases, including kernel driver development, and lightweight process virtualization.
Speaker bio
Justin Cormack has been a Unix user, developer and sysadmin since the early 1990s. He is based in London and works on open source cloud applications, Lua, and the NetBSD rump kernel project. He has been a NetBSD developer since early 2014.
Revisão: Forwarding Metamorphosis: Fast Programmable Match-Action Processing ...Bruno Castelucci
Lendo e apresentando o artigo: Forwarding Metamorphosis: Fast Programmable Match-Action Processing in Hardware for SDN.
http://conferences.sigcomm.org/sigcomm/2013/program.php
http://conferences.sigcomm.org/sigcomm/2013/papers/sigcomm/p99.pdf
In-memory processing has started to become the norm in large scale data handling. This is aclose to the metal analysis of highly important but often neglected aspects of memory accesstimes and how it impacts big data and NoSQL technologies.We cover aspects such as the TLB, the Transparent Huge Pages, the QPI Link, Hyperthreading and the impact of virtualization on high-memory footprint applications. We present benchmarks of various technologies ranging from Cloudera’s Impala to Couchbase and how they are impacted by the underlying hardware.The key takeaway is a better understanding of how to size a cluster, how to choose a cloud provider and an instance type for big data and NoSQL workloads and why not every core or GB of RAM is created equal.
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...Anne Nicolas
Ftrace is the official tracer of the Linux kernel. It was added in 2008, and in 2009 came trace-cmd which was a command line tool that would make interaction with ftrace easier. Shortly after that, KernelShark was created as a GUI for trace-cmd interface. But as KernelShark and trace-cmd were mostly side projects, there wasn't as much activity that they deserved. trace-cmd was updated more often, but KernelShark has suffered with bit-rot for some time. But all that has changed recently as VMware has active developers working on it.
KernelShark has been completely rewritten from scratch and version 1.0 is due to be released in August of 2018 (has already been released as of this talk). This will discuss what changed, how to use the new tool and what is coming in the future.
HBaseCon2017 gohbase: Pure Go HBase ClientHBaseCon
gohbase is an implementation of an HBase client in pure Go: https://github.com/tsuna/gohbase. In this presentation we'll talk about its architecture and compare its performance against the native Java HBase client as well as AsyncHBase (http://opentsdb.github.io/asynchbase/) and some nice characteristics of golang that resulted in a simpler implementation.
Cloud Computing in the Cloud (Hadoop.tw Meetup @ 2015/11/23)Jeff Hung
It is a common believe that Hadoop should run on physical servers. However, this requires huge capital investment in the beginning while you have no guarantee for the returns. Therefore, things usually end up in proving big-data with not-that-big data. One approach to workaround this dilemma is to run Cloud Computing in the Cloud. With the elastic that AWS provides, you could spend little but run big!! However, is it really a good idea? In this sharing, we will try to answer it – based on the result from an 1-year journey with real application and real big-data.
Infrastructure review - Shining a light on the Black BoxMiklos Szel
Scenario: You work as a consultant and a new client has just signed on. Their DBA left suddenly leaving nothing but some outdated documentation in their wiki. After the kick-off meeting you realise that the operations and the development teams know little to none about the databases. They have been encountering intermittent problems with the application’s performance and suspect it’s related to the databases. You are told: "Please fix it ASAP!” So you have your public key installed on their jumphost and they manage to provide you with a 6 character long mysql root password. This is where your journey begins! During this session you will learn some of the best practices around discovering a new environment, finding possible threats and weaknesses and determining what key metrics to focus on for performance and reliability. We will cover architecture, replication, OS and MySQL level configuration, storage engines, failover strategies, backup and restores, monitoring, query tuning and possible ways to save money. The goal at the end of the presentation is to have a prioritized action plan. I will also explain the usage and the output of some tools/wrappers that help during an infrastructure review. Examples include creation of maximum integetr usage reports, table fragmentation and duplicate keys (we will be leveraging multiple Percona Toolkit scripts but also some lesser known tools as well). It is often easy to overlook underlying problems in the infrastructure during day-to-day operations, so this presentation will aim to highlight how to identify and resolve potential bottlenecks with your systems.
Similar to Optcarrot: A Pure-Ruby NES Emulator (20)
_7 OTT App Builders to Support the Development of Your Video Applications_.pdfMega P
Due to their ability to produce engaging content more quickly, over-the-top (OTT) app builders have made the process of creating video applications more accessible. The invitation to explore these platforms emphasizes how over-the-top (OTT) applications hold the potential to transform digital entertainment.
Scandal! Teasers June 2024 on etv Forum.co.zaIsaac More
Monday, 3 June 2024
Episode 47
A friend is compelled to expose a manipulative scheme to prevent another from making a grave mistake. In a frantic bid to save Jojo, Phakamile agrees to a meeting that unbeknownst to her, will seal her fate.
Tuesday, 4 June 2024
Episode 48
A mother, with her son's best interests at heart, finds him unready to heed her advice. Motshabi finds herself in an unmanageable situation, sinking fast like in quicksand.
Wednesday, 5 June 2024
Episode 49
A woman fabricates a diabolical lie to cover up an indiscretion. Overwhelmed by guilt, she makes a spontaneous confession that could be devastating to another heart.
Thursday, 6 June 2024
Episode 50
Linda unwittingly discloses damning information. Nhlamulo and Vuvu try to guide their friend towards the right decision.
Friday, 7 June 2024
Episode 51
Jojo's life continues to spiral out of control. Dintle weaves a web of lies to conceal that she is not as successful as everyone believes.
Monday, 10 June 2024
Episode 52
A heated confrontation between lovers leads to a devastating admission of guilt. Dintle's desperation takes a new turn, leaving her with dwindling options.
Tuesday, 11 June 2024
Episode 53
Unable to resort to violence, Taps issues a verbal threat, leaving Mdala unsettled. A sister must explain her life choices to regain her brother's trust.
Wednesday, 12 June 2024
Episode 54
Winnie makes a very troubling discovery. Taps follows through on his threat, leaving a woman reeling. Layla, oblivious to the truth, offers an incentive.
Thursday, 13 June 2024
Episode 55
A nosy relative arrives just in time to thwart a man's fatal decision. Dintle manipulates Khanyi to tug at Mo's heartstrings and get what she wants.
Friday, 14 June 2024
Episode 56
Tlhogi is shocked by Mdala's reaction following the revelation of their indiscretion. Jojo is in disbelief when the punishment for his crime is revealed.
Monday, 17 June 2024
Episode 57
A woman reprimands another to stay in her lane, leading to a damning revelation. A man decides to leave his broken life behind.
Tuesday, 18 June 2024
Episode 58
Nhlamulo learns that due to his actions, his worst fears have come true. Caiphus' extravagant promises to suppliers get him into trouble with Ndu.
Wednesday, 19 June 2024
Episode 59
A woman manages to kill two birds with one stone. Business doom looms over Chillax. A sobering incident makes a woman realize how far she's fallen.
Thursday, 20 June 2024
Episode 60
Taps' offer to help Nhlamulo comes with hidden motives. Caiphus' new ideas for Chillax have MaHilda excited. A blast from the past recognizes Dintle, not for her newfound fame.
Friday, 21 June 2024
Episode 61
Taps is hungry for revenge and finds a rope to hang Mdala with. Chillax's new job opportunity elicits mixed reactions from the public. Roommates' initial meeting starts off on the wrong foot.
Monday, 24 June 2024
Episode 62
Taps seizes new information and recruits someone on the inside. Mary's new job
Young Tom Selleck: A Journey Through His Early Years and Rise to Stardomgreendigital
Introduction
When one thinks of Hollywood legends, Tom Selleck is a name that comes to mind. Known for his charming smile, rugged good looks. and the iconic mustache that has become synonymous with his persona. Tom Selleck has had a prolific career spanning decades. But, the journey of young Tom Selleck, from his early years to becoming a household name. is a story filled with determination, talent, and a touch of luck. This article delves into young Tom Selleck's life, background, early struggles. and pivotal moments that led to his rise in Hollywood.
Follow us on: Pinterest
Early Life and Background
Family Roots and Childhood
Thomas William Selleck was born in Detroit, Michigan, on January 29, 1945. He was the second of four children in a close-knit family. His father, Robert Dean Selleck, was a real estate investor and executive. while his mother, Martha Selleck, was a homemaker. The Selleck family relocated to Sherman Oaks, California. when Tom was a child, setting the stage for his future in the entertainment industry.
Education and Early Interests
Growing up, young Tom Selleck was an active and athletic child. He attended Grant High School in Van Nuys, California. where he excelled in sports, particularly basketball. His tall and athletic build made him a standout player, and he earned a basketball scholarship to the University of Southern California (U.S.C.). While at U.S.C., Selleck studied business administration. but his interests shifted toward acting.
Discovery of Acting Passion
Tom Selleck's journey into acting was serendipitous. During his time at U.S.C., a drama coach encouraged him to try acting. This nudge led him to join the Hills Playhouse, where he began honing his craft. Transitioning from an aspiring athlete to an actor took time. but young Tom Selleck became drawn to the performance world.
Early Career Struggles
Breaking Into the Industry
The path to stardom was a challenging one for young Tom Selleck. Like many aspiring actors, he faced many rejections and struggled to find steady work. A series of minor roles and guest appearances on television shows marked his early career. In 1965, he debuted on the syndicated show "The Dating Game." which gave him some exposure but did not lead to immediate success.
The Commercial Breakthrough
During the late 1960s and early 1970s, Selleck began appearing in television commercials. His rugged good looks and charismatic presence made him a popular brand choice. He starred in advertisements for Pepsi-Cola, Revlon, and Close-Up toothpaste. These commercials provided financial stability and helped him gain visibility in the industry.
Struggling Actor in Hollywood
Despite his success in commercials. breaking into large acting roles remained a challenge for young Tom Selleck. He auditioned and took on small parts in T.V. shows and movies. Some of his early television appearances included roles in popular series like Lancer, The F.B.I., and Bracken's World. But, it would take a
Experience the thrill of Progressive Puzzle Adventures, like Scavenger Hunt Games and Escape Room Activities combined Solve Treasure Hunt Puzzles online.
From the Editor's Desk: 115th Father's day Celebration - When we see Father's day in Hindu context, Nanda Baba is the most vivid figure which comes to the mind. Nanda Baba who was the foster father of Lord Krishna is known to provide love, care and affection to Lord Krishna and Balarama along with his wife Yashoda; Letter’s to the Editor: Mother's Day - Mother is a precious life for their children. Mother is life breath for her children. Mother's lap is the world happiness whose debt can never be paid.
Tom Selleck Net Worth: A Comprehensive Analysisgreendigital
Over several decades, Tom Selleck, a name synonymous with charisma. From his iconic role as Thomas Magnum in the television series "Magnum, P.I." to his enduring presence in "Blue Bloods," Selleck has captivated audiences with his versatility and charm. As a result, "Tom Selleck net worth" has become a topic of great interest among fans. and financial enthusiasts alike. This article delves deep into Tom Selleck's wealth, exploring his career, assets, endorsements. and business ventures that contribute to his impressive economic standing.
Follow us on: Pinterest
Early Life and Career Beginnings
The Foundation of Tom Selleck's Wealth
Born on January 29, 1945, in Detroit, Michigan, Tom Selleck grew up in Sherman Oaks, California. His journey towards building a large net worth began with humble origins. , Selleck pursued a business administration degree at the University of Southern California (USC) on a basketball scholarship. But, his interest shifted towards acting. leading him to study at the Hills Playhouse under Milton Katselas.
Minor roles in television and films marked Selleck's early career. He appeared in commercials and took on small parts in T.V. series such as "The Dating Game" and "Lancer." These initial steps, although modest. laid the groundwork for his future success and the growth of Tom Selleck net worth. Breakthrough with "Magnum, P.I."
The Role that Defined Tom Selleck's Career
Tom Selleck's breakthrough came with the role of Thomas Magnum in the CBS television series "Magnum, P.I." (1980-1988). This role made him a household name and boosted his net worth. The series' popularity resulted in Selleck earning large salaries. leading to financial stability and increased recognition in Hollywood.
"Magnum P.I." garnered high ratings and critical acclaim during its run. Selleck's portrayal of the charming and resourceful private investigator resonated with audiences. making him one of the most beloved television actors of the 1980s. The success of "Magnum P.I." played a pivotal role in shaping Tom Selleck net worth, establishing him as a major star.
Film Career and Diversification
Expanding Tom Selleck's Financial Portfolio
While "Magnum, P.I." was a cornerstone of Selleck's career, he did not limit himself to television. He ventured into films, further enhancing Tom Selleck net worth. His filmography includes notable movies such as "Three Men and a Baby" (1987). which became the highest-grossing film of the year, and its sequel, "Three Men and a Little Lady" (1990). These box office successes contributed to his wealth.
Selleck's versatility allowed him to transition between genres. from comedies like "Mr. Baseball" (1992) to westerns such as "Quigley Down Under" (1990). This diversification showcased his acting range. and provided many income streams, reinforcing Tom Selleck net worth.
Television Resurgence with "Blue Bloods"
Sustaining Wealth through Consistent Success
In 2010, Tom Selleck began starring as Frank Reagan i
Modern Radio Frequency Access Control Systems: The Key to Efficiency and SafetyAITIX LLC
Today's fast-paced environment worries companies of all sizes about efficiency and security. Businesses are constantly looking for new and better solutions to solve their problems, whether it's data security or facility access. RFID for access control technologies have revolutionized this.
Hollywood Actress - The 250 hottest galleryZsolt Nemeth
Hollywood Actress amazon album eminent worldwide media, female-singer, actresses, alhletina-woman, 250 collection.
Highest and photoreal-print exclusive testament PC collage.
Focused television virtuality crime, novel.
The sheer afterlife of the work is activism-like hollywood-actresses point com.
173 Illustrate, 250 gallery, 154 blog, 120 TV serie logo, 17 TV president logo, 183 active hyperlink.
HD AI face enhancement 384 page plus Bowker ISBN, Congress LLCL or US Copyright.
240529_Teleprotection Global Market Report 2024.pdfMadhura TBRC
The teleprotection market size has grown
exponentially in recent years. It will grow from
$21.92 billion in 2023 to $28.11 billion in 2024 at a
compound annual growth rate (CAGR) of 28.2%. The
teleprotection market size is expected to see
exponential growth in the next few years. It will grow
to $70.77 billion in 2028 at a compound annual
growth rate (CAGR) of 26.0%.
Meet Dinah Mattingly – Larry Bird’s Partner in Life and Loveget joys
Get an intimate look at Dinah Mattingly’s life alongside NBA icon Larry Bird. From their humble beginnings to their life today, discover the love and partnership that have defined their relationship.
Matt Rife Cancels Shows Due to Health Concerns, Reschedules Tour Dates.pdfAzura Everhart
Matt Rife's comedy tour took an unexpected turn. He had to cancel his Bloomington show due to a last-minute medical emergency. Fans in Chicago will also have to wait a bit longer for their laughs, as his shows there are postponed. Rife apologized and assured fans he'd be back on stage soon.
https://www.theurbancrews.com/celeb/matt-rife-cancels-bloomington-show/
Skeem Saam in June 2024 available on ForumIsaac More
Monday, June 3, 2024 - Episode 241: Sergeant Rathebe nabs a top scammer in Turfloop. Meikie is furious at her uncle's reaction to the truth about Ntswaki.
Tuesday, June 4, 2024 - Episode 242: Babeile uncovers the truth behind Rathebe’s latest actions. Leeto's announcement shocks his employees, and Ntswaki’s ordeal haunts her family.
Wednesday, June 5, 2024 - Episode 243: Rathebe blocks Babeile from investigating further. Melita warns Eunice to stay clear of Mr. Kgomo.
Thursday, June 6, 2024 - Episode 244: Tbose surrenders to the police while an intruder meddles in his affairs. Rathebe's secret mission faces a setback.
Friday, June 7, 2024 - Episode 245: Rathebe’s antics reach Kganyago. Tbose dodges a bullet, but a nightmare looms. Mr. Kgomo accuses Melita of witchcraft.
Monday, June 10, 2024 - Episode 246: Ntswaki struggles on her first day back at school. Babeile is stunned by Rathebe’s romance with Bullet Mabuza.
Tuesday, June 11, 2024 - Episode 247: An unexpected turn halts Rathebe’s investigation. The press discovers Mr. Kgomo’s affair with a young employee.
Wednesday, June 12, 2024 - Episode 248: Rathebe chases a criminal, resorting to gunfire. Turf High is rife with tension and transfer threats.
Thursday, June 13, 2024 - Episode 249: Rathebe traps Kganyago. John warns Toby to stop harassing Ntswaki.
Friday, June 14, 2024 - Episode 250: Babeile is cleared to investigate Rathebe. Melita gains Mr. Kgomo’s trust, and Jacobeth devises a financial solution.
Monday, June 17, 2024 - Episode 251: Rathebe feels the pressure as Babeile closes in. Mr. Kgomo and Eunice clash. Jacobeth risks her safety in pursuit of Kganyago.
Tuesday, June 18, 2024 - Episode 252: Bullet Mabuza retaliates against Jacobeth. Pitsi inadvertently reveals his parents’ plans. Nkosi is shocked by Khwezi’s decision on LJ’s future.
Wednesday, June 19, 2024 - Episode 253: Jacobeth is ensnared in deceit. Evelyn is stressed over Toby’s case, and Letetswe reveals shocking academic results.
Thursday, June 20, 2024 - Episode 254: Elizabeth learns Jacobeth is in Mpumalanga. Kganyago's past is exposed, and Lehasa discovers his son is in KZN.
Friday, June 21, 2024 - Episode 255: Elizabeth confirms Jacobeth’s dubious activities in Mpumalanga. Rathebe lies about her relationship with Bullet, and Jacobeth faces theft accusations.
Monday, June 24, 2024 - Episode 256: Rathebe spies on Kganyago. Lehasa plans to retrieve his son from KZN, fearing what awaits.
Tuesday, June 25, 2024 - Episode 257: MaNtuli fears for Kwaito’s safety in Mpumalanga. Mr. Kgomo and Melita reconcile.
Wednesday, June 26, 2024 - Episode 258: Kganyago makes a bold escape. Elizabeth receives a shocking message from Kwaito. Mrs. Khoza defends her husband against scam accusations.
Thursday, June 27, 2024 - Episode 259: Babeile's skillful arrest changes the game. Tbose and Kwaito face a hostage crisis.
Friday, June 28, 2024 - Episode 260: Two women face the reality of being scammed. Turf is rocked by breaking
3. • To drive “Ruby3x3”
– Matz said “Ruby 3 will be 3 times faster than Ruby 2.0”
– Optcarrot is a CPU-intensive, real-life benchmark
• Currently works at 20 fps in Ruby 2.0 60 fps in 3.0!
• A carrot to let horses (Ruby committers) optimize Ruby
• To challenge Ruby’s limit
– NES video resolution: 256 x 240 pixels / 60 fps
– We need to do all other tasks in 0.8 sec.? Impossible?
(256*240*60).times do |i|
ary[0] = 0
end
0.2 sec.
3
4. • Famicom programming with Ruby
(takkaw, 2007)
– Presentation NES ROM by Ruby
• MRI's incremental GC
(authornari, 2008)
– Mario-like game "Nario" is used
to demonstrate the real-time GC
• Burn (remore, 2014)
– A framework to create NES ROM
in Ruby
4
5. • NES architecture in three minutes
• How I achieved 20 fps
• Ruby interpreters’ benchmark
• Towards 60 fps
• Speaker's award & Conclusion
5
6. • The details of NES architecture
– In short: “See http://wiki.nesdev.com/ !”
• How to find the bottleneck
– In short: “Use stackprof!”
6
川崎Ruby会議01
(2016/08/20)
• I’ll talk these topics at
“Kawasaki Ruby Kaigi 01”
7. • NES Architecture in three minutes
• How I achieved 20 fps
• Ruby interpreters’ benchmark
• Towards 60 fps
• Speaker's award & Conclusion
7
8. CPU GPU
Program ROM Bitmap ROM
Cartridge
NES
RAM
(2 kB)
VRAM
(2 kB)
control
read
read/write
read
render
read/write
To be precise: GPU is called as “PPU” (Picture Processing Unit) in NES
interrupt
8
9. GPU
80%
CPU
10%
others
10%
Execution time
ratio
• Why does GPU emulation
take so much?
– GPU runs at higher
clock speed than CPU
• GPU: 5.3 MHz
• CPU: 1.8 MHz
– GPU does many
complex tasks
• Background rendering
• Sprite rendering
• Scrolling
• Conflict detection
• Interrupts
9
10. • Per-pixel tasks (i.e. 256 x 240 x 60 = 3.7M times per second)
1. Identify what bitmap is shown here
2. Read attribute data (color, flip flag, z-index)
3. Read bitmap data from the ROM
4. Assemble them into video signal
Background map
Attribute map
VRAM
GPU2
1
3
4
Target
pixel
To be precise: These tasks are actually done per eight pixels
10
Bitmap ROM
Cartridge
12. • NES Architecture in three minutes
• How I achieved 20 fps
– How to emulate CPU-GPU parallelism
– How to optimize GPU emulation
• Ruby interpreters’ benchmark
• Towards 60 fps
• Speaker's award & Conclusion
12
13. • Naïve approach: emulate CPU & GPU per clock
1. Run the CPU for one clock
2. Run the GPU for three clocks
3. Repeat 1 and 2
– Simple and accurate
– Very slow (~ 3 fps) because of too many method calls
CPU step
step
step
step
step
step
step
step
step
step
step
step
step
step
step
step
clock
GPU
13
14. • “Catch-up” method: emulate CPU&GPU per control
1. Run the CPU until it tries to control the GPU
2. Run the GPU until it catch up with the CPU
3. Repeat 1 and 2
– Accurate and fast (~ 10 fps)
CPU run
catchup
run
catchup
run
clock
GPU CPU attempts to
control GPU
14
15. • Naïve approach: per-pixel emulation
– Just as like the actual hardware
Bitmap ROM
Background map
Attribute map
VRAM
GPU2
1
3
4
This calculation is done for each iteration Slow!
15
Cartridge
16. • Pre-render the screen and update it on demand
Background map
Attribute map
VRAM
GPU
screen buffer
When VRAM is
modified by CPU,
Only invalidated pixels
is updated
Transported to TV
per frame
This explanation is over exaggerated!
Actually, the GPU emulation loop is not removed completely.
16
Bitmap ROM
Cartridge
18. • NES Architecture in three minutes
• How I achieved 20 fps
• Ruby interpreters’ benchmark
• Towards 60 fps
• Speaker's award & Conclusion
18
19. • Is not so big: <5000 lines of code
– cf. redmine: >30000 LOC
• Requires no library (in no-GUI mode)
– It works on miniruby
– ruby-ffi is used for GUI (SDL2)
• Uses only basic Ruby features
– It works on ruby 1.8 / mruby / topaz / opal
(with shim and/or systematic modification of source code)
19
20. 28.7
28.1
25.5
26.6
25.0
21.4
5.83
21.9
39.2
25.0
4.10
7.48
27.0
0.0287
0.0 10.0 20.0 30.0 40.0
trunk
ruby23
ruby22
ruby21
ruby20
ruby193
ruby187
omrpreview
jruby9k
jruby17
rubinius
mruby
topaz
opal
20
MRI has been improved
(1.81.92.02.3)
OMR preview isn’t fast?
(MRI 2.2 w/ JIT)
JRuby9k is the fastest
ruby 2.0 achives >20 fps
(important for Ruby3x3)
Optcarrot works on
subset Ruby impls.
21. • JRuby 9k is the fastest:
“Deoptimization” looks a promising approach
– At first, an optimized byte-code is generated with
ignoring rare/pathological cases
– When needed, it is discarded and a naïve byte-code is
regenerated
– BTW: JRuby‘s boot time is too bad
• OMR is not so fast?
– JIT has no advantage?
• Method calls and built-in methods may be still bottleneck
– OMR seems not to support opt_case_dispatch yet
• i.e., a case statement is not optimized well?
21
22. • NES Architecture in three minutes
• How I achieved 20 fps
• Ruby interpreters’ benchmark
• Towards 60 fps
• Speaker's award & Conclusion
22
23. ™
• We have kept the code reasonably clean so far
• Now, we use any means to achieve the speed
• CAUTION: Casual Ruby programmers MUST NOT
use the following ProTips™
– This is an experiment to study how to improve Ruby
implementation
23
24. ™
• Method call is slow
– Replace it with its method definition
while catchup?
inc_addr
end
while catchup?
@addr += 1
end
28 fps 40 fps
24
25. ™
• Instance variable access is slow
– Replace it with local variable
– Note: the variable must not be used out of this method
while catchup?
@addr += 1
end
begin
addr = @addr
while catchup?
addr += 1
end
ensure
@addr = addr
end
40 fps 47 fps
25
26. • Batch multiple frequent
actions across some clocks
™ while catchup?
if can_be_fast?
# fast-path
do_A
do_B
do_C
@clock += 3
else
case @clock
when 1 then do_A
when 2 then do_B
when 3 then do_C
...
end
@clock += 1
end
end
while catchup?
case @clock
when 1 then do_A
when 2 then do_B
when 3 then do_C
...
end
@clock += 1
end
47 fps 63 fps 26
28. • Used Regexp to systematically rewrite the code
– instead of hand-rewriting
• Used Welch’s t-test to confirm each optimization
src = File.read(__FILE__)
src.gsub!(/.../) { ... } # method inlining
src.gsub!(/.../) { ... } # ivar localization
eval(src)
28
31. • NES Architecture in three minutes
• How I achieved 20 fps
• Ruby interpreters’ benchmark
• Towards 60 fps
• Speaker's award & Conclusion
31
32. • The first person who
improved MRI performance
by using Optcarrot
– Instance variable access has
been improved about 10%
[Bug #12274]
• Optcarrot has already
started to improve Ruby!
32
33. • Optcarrot, a pure-Ruby NES emulator
– Non-trivial benchmark for Ruby implementations
• Wide-range Ruby implementation benchmark
– AFAIK, this is the first real-life benchmark to compare
MRI / Jruby / Rubinius / mruby / topaz / opal
• ProTips™ for boosting a Ruby program
– Need to improve method calls and instance variables
instead of JIT?
• More details?
33
川崎Ruby会議01
(2016/08/20)