A status update on JRuby, covering compatibility, Rails, and next-gen performance numbers. JRuby is currently the fastest way to run Rails apps, and we're doing work to make it even faster in the future.
Down the Rabbit Hole: An Adventure in JVM WonderlandCharles Nutter
The document discusses exploring interesting Java features and how they are compiled and executed by the JVM. It will look at bytecode, compiler logs, and native code generated for simple Java examples. The goal is to understand hidden performance costs, how code design impacts performance, and what the JVM can and cannot optimize. It begins with a "Hello World" example and examines the bytecode, compiler logs showing inlining, and native assembly code generated by the JIT compiler.
The "n" in the PrintCompilation output indicates that the method was not compiled, but is on deck to be compiled. So in this case, java.lang.Object::hashCode was not yet compiled, but is a candidate for compilation if/when it is called more.
JRuby 9000 introduced a new intermediate representation that allows us to use classic compiler strategies to optimize Ruby. This talk describes what we're doing with this new IR and why current JVM capabilities are not sufficient.
JRuby 9000 - Taipei Ruby User's Group 2015Charles Nutter
The document discusses JRuby 9000, a new version of JRuby that runs on a new runtime based on an intermediate representation (IR). Some key points:
- JRuby 9000 includes major performance improvements like just-in-time compiling of blocks and optimized define_method performance.
- The new runtime represents code as IR instructions instead of an AST for better optimization capabilities. It allows registering passes to optimize the IR.
- Future work includes improved inlining, numeric specialization to use primitives on the JVM, and leveraging ahead-of-time compilation capabilities being added to the JVM to improve startup time.
- The overall goal is to continue optimizing JRuby to perform
Rapid Application Design in Financial ServicesAerospike
Applying internet NoSQL design patterns to fraud detection and risk scoring, including when to use SQL and when to use NoSQL. The state of NAND Flash and NVMe is also discussed, as well as storage class memory futures with Intel's 3D Xpoint technology.
This talk was presented in LA at the following meetup:
http://www.meetup.com/scalela/events/233396111/
This document summarizes a presentation about a new way of developing Perl applications and the future of gperl, a fast Perl-like language. It discusses compiler modules for lexical analysis, parsing, and code generation that were originally developed for gperl and can now be used to build various tools and applications. These include a transpiler to run Perl 5 code in web browsers, a framework called PerlMotion for building iOS and OSX apps with Perl, and a static analysis tool for detecting copied code. The presentation encourages contributions to related open source projects and outlines plans to expand the capabilities of the static analysis and type inference engines.
Down the Rabbit Hole: An Adventure in JVM WonderlandCharles Nutter
The document discusses exploring interesting Java features and how they are compiled and executed by the JVM. It will look at bytecode, compiler logs, and native code generated for simple Java examples. The goal is to understand hidden performance costs, how code design impacts performance, and what the JVM can and cannot optimize. It begins with a "Hello World" example and examines the bytecode, compiler logs showing inlining, and native assembly code generated by the JIT compiler.
The "n" in the PrintCompilation output indicates that the method was not compiled, but is on deck to be compiled. So in this case, java.lang.Object::hashCode was not yet compiled, but is a candidate for compilation if/when it is called more.
JRuby 9000 introduced a new intermediate representation that allows us to use classic compiler strategies to optimize Ruby. This talk describes what we're doing with this new IR and why current JVM capabilities are not sufficient.
JRuby 9000 - Taipei Ruby User's Group 2015Charles Nutter
The document discusses JRuby 9000, a new version of JRuby that runs on a new runtime based on an intermediate representation (IR). Some key points:
- JRuby 9000 includes major performance improvements like just-in-time compiling of blocks and optimized define_method performance.
- The new runtime represents code as IR instructions instead of an AST for better optimization capabilities. It allows registering passes to optimize the IR.
- Future work includes improved inlining, numeric specialization to use primitives on the JVM, and leveraging ahead-of-time compilation capabilities being added to the JVM to improve startup time.
- The overall goal is to continue optimizing JRuby to perform
Rapid Application Design in Financial ServicesAerospike
Applying internet NoSQL design patterns to fraud detection and risk scoring, including when to use SQL and when to use NoSQL. The state of NAND Flash and NVMe is also discussed, as well as storage class memory futures with Intel's 3D Xpoint technology.
This talk was presented in LA at the following meetup:
http://www.meetup.com/scalela/events/233396111/
This document summarizes a presentation about a new way of developing Perl applications and the future of gperl, a fast Perl-like language. It discusses compiler modules for lexical analysis, parsing, and code generation that were originally developed for gperl and can now be used to build various tools and applications. These include a transpiler to run Perl 5 code in web browsers, a framework called PerlMotion for building iOS and OSX apps with Perl, and a static analysis tool for detecting copied code. The presentation encourages contributions to related open source projects and outlines plans to expand the capabilities of the static analysis and type inference engines.
Apache Spark 2.0 includes improvements that provide considerable speedups for CPU-intensive queries through techniques like code generation. Profiling tools like flame graphs can help analyze where CPU cycles are spent by visualizing stack traces. Flame graphs are useful for performance troubleshooting but have limitations. Testing Spark applications locally and through unit tests allows faster iteration compared to running on clusters and saves resources. It is also important to test with local approximations of distributed components like HDFS and Hive.
Tomas Doran presented on their implementation of Logstash at TIM Group to process over 55 million messages per day. Their applications are all Java/Scala/Clojure and they developed their own library to send structured log events as JSON to Logstash using ZeroMQ for reliability. They index data in Elasticsearch and use it for metrics, alerts and dashboards but face challenges with data growth.
It is mainly about the multithreading and the multiprocessing in Python, and *in Python's flavor*.
It's also the share at Taipei.py [1].
[1] http://www.meetup.com/Taipei-py/events/220452029/
High performance network programming on the jvm oscon 2012 Erik Onnen
This document summarizes a talk on high performance network programming on the JVM. The talk discusses choosing between synchronous and asynchronous I/O, with examples of when each approach is best. It also covers how to optimize synchronous I/O on the JVM to maximize throughput. The document provides benchmarks comparing the performance of a simple synchronous memcache client versus an asynchronous one.
The document introduces SD, a peer-to-peer bug tracking tool developed by Best Practical to allow tracking bugs offline and syncing work across devices. SD uses a decentralized model where each installation can pull changes from any other replica. It supports syncing with other bug trackers like RT, Trac and Google Code. The author argues that cloud services make users dependent while SD empowers fully offline and distributed work by syncing like users naturally share files.
Presentation from JVMLS 2015
One bottleneck in the Nashorn JavaScript engine is startup time. Nashorn, as it works currently in Java 8, JITs everything to Java bytecode, accruing overhead in code generation and class installation. Nashorn in Java 9, can in unfortunate cases, increase this compilation workload significantly, as the new optimistic type system, which has greatly increased steady state performance, requires more code invalidation on warmup. Based on our optimistic type compilation framework, which contains all the mechanisms for quick code replacement and on stack replacement on the bytecode level, I will present the new execution architecture we are developing. It will minimizes compile time intelligently, while maintaining or possible even increasing code performance, due to extra profiling and execution frequency information being passed to the JIT. I will also talk about what the future will bring in terms of other dynamic languages on the Nashorn engine, partial method compilation of hot paths and other intriguing possibilities that our new execution model opens up.
This document introduces Failsafe, which provides latency and fault tolerance capabilities for distributed systems. It discusses how Failsafe compares to Hystrix and how it is used at Coupang. Key features of Failsafe include retry policies, circuit breakers, fallbacks, and asynchronous execution. Event listeners and policy composition patterns are also covered.
The document discusses testing asynchronous Node.js code. It describes the current approach of using callbacks in tests but notes issues with this approach. It then discusses using stubs and mocks to make asynchronous code synchronous so it can be tested more easily. Finally, it discusses the benefits of writing many small "microtests" that isolate and test individual functions and paths through the code rather than large integration tests.
This document discusses the development of Apache Pig on Tez, an execution engine for Pig jobs. Pig on Tez allows Pig workflows to be executed as directed acyclic graphs (DAGs) using Tez, improving performance over the default MapReduce execution. Key benefits of Tez include eliminating intermediate data writes, reducing job launch overhead, and allowing more flexible data flows. However, challenges remain around automatically determining optimal parallelism and integrating Tez with user interface and monitoring tools. Future work is needed to address these issues.
Ehcache 3: JSR-107 on steroids at Devoxx MoroccoLouis Jacomet
The document summarizes Louis Jacomet's presentation on Ehcache 3. Some key points:
- Ehcache 3 is based on JSR-107 and improves on caching APIs and semantics. It supports explicit lifecycles, proper typing for caches, and custom serialization.
- Ehcache 3 enables cache-through and write-behind patterns to integrate caching with databases. It allows caching and persisting data across multiple tiers including heap, disk, and clustered storage.
- New features in Ehcache 3 include eviction veto/prioritization, transactions, automatic resource control, and resilience strategies to handle storage and timeout failures. Clustering is implemented using Terracotta.
This document summarizes a presentation about the future of the Rake gem and domain-specific languages (DSLs) in Ruby.
The presentation discusses:
1. How Rake works as a Make-like program implemented in Ruby syntax with tasks and dependencies. Rake files use standard Ruby syntax.
2. Examples of common patterns for building internal DSLs in Ruby using class/module methods, method definition, implicit/explicit code blocks, and instance evaluation.
3. How popular Ruby gems like Rake, Bundler, and Thor use DSL techniques and inherit from each other to provide domain-specific interfaces.
When performance hits rock-bottom everybody (and their dog) is called upon and all of a sudden developers should have been responsible for last half a year or so and code with performance in mind (and deadlines, but that of course goes unsaid). So, here I'm talking about what can a dev do to meet those unreasonable demands) and what might he do anticipating them.
Strictly JVM, mostly Sun Hotspot impl, but number of points can be used to other JVMs as wel
A brief look at a few IP cameras, wireless extenders and routers - a significant number have unpatched issues such as cross-site scripting, cross-site request forgery and authentication bypass, meaning we can take control of devices, change wireless settings and obtain a copy of all video on certain devices, all by having the unsuspecting user visit a web page we control.
Новый InterSystems: open-source, митапы, хакатоныTimur Safin
Presentation for the 1st InterSystems Meetup in the Minsk:
- New and better InterSystems changes their practice.
- open-source repositories, meetups, and hackathon;
- CPM (package manager) as a good example of open-source project
How to run system administrator recruitment process? By creating platform based on open source parts in just 2 nights! I gave this talk in Poland / Kraków OWASP chapter meeting on 17th October 2013 at our local Google for Entrepreneurs site. It's focused on security and also shows how to create recruitment process in CTF / challenge way.
This story covers mostly security details of this whole platform. There's great chance, that I will give another talk about this system but this time focusing on technical details. Stay tuned ;)
Experiments in Sharing Java VM Technology with CRubyMatthew Gaudet
IBM is developing a just-in-time (JIT) compiler called Testarossa based on its Open Runtime (OMR) toolkit. The goal is to integrate the JIT compiler into MRI Ruby to improve performance without changing how MRI works. So far, the JIT supports most opcodes and can run Rails applications, but performance gains are modest. IBM hopes to collaborate with the Ruby community to further optimize Ruby and help make it faster.
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.
JRuby allows running Ruby code on the Java Virtual Machine. It has the advantages of accessing Java libraries from Ruby and embedding Ruby in Java applications. Gems mostly work the same in JRuby as Ruby MRI, though some with native extensions may need alternatives. ActiveRecord can use JDBC drivers in JRuby to connect to databases. Converting Rails apps may require updating gems to specify platforms. JRuby is well-suited for deployment on Java application servers using WAR files generated by the Warbler gem.
Apache Spark 2.0 includes improvements that provide considerable speedups for CPU-intensive queries through techniques like code generation. Profiling tools like flame graphs can help analyze where CPU cycles are spent by visualizing stack traces. Flame graphs are useful for performance troubleshooting but have limitations. Testing Spark applications locally and through unit tests allows faster iteration compared to running on clusters and saves resources. It is also important to test with local approximations of distributed components like HDFS and Hive.
Tomas Doran presented on their implementation of Logstash at TIM Group to process over 55 million messages per day. Their applications are all Java/Scala/Clojure and they developed their own library to send structured log events as JSON to Logstash using ZeroMQ for reliability. They index data in Elasticsearch and use it for metrics, alerts and dashboards but face challenges with data growth.
It is mainly about the multithreading and the multiprocessing in Python, and *in Python's flavor*.
It's also the share at Taipei.py [1].
[1] http://www.meetup.com/Taipei-py/events/220452029/
High performance network programming on the jvm oscon 2012 Erik Onnen
This document summarizes a talk on high performance network programming on the JVM. The talk discusses choosing between synchronous and asynchronous I/O, with examples of when each approach is best. It also covers how to optimize synchronous I/O on the JVM to maximize throughput. The document provides benchmarks comparing the performance of a simple synchronous memcache client versus an asynchronous one.
The document introduces SD, a peer-to-peer bug tracking tool developed by Best Practical to allow tracking bugs offline and syncing work across devices. SD uses a decentralized model where each installation can pull changes from any other replica. It supports syncing with other bug trackers like RT, Trac and Google Code. The author argues that cloud services make users dependent while SD empowers fully offline and distributed work by syncing like users naturally share files.
Presentation from JVMLS 2015
One bottleneck in the Nashorn JavaScript engine is startup time. Nashorn, as it works currently in Java 8, JITs everything to Java bytecode, accruing overhead in code generation and class installation. Nashorn in Java 9, can in unfortunate cases, increase this compilation workload significantly, as the new optimistic type system, which has greatly increased steady state performance, requires more code invalidation on warmup. Based on our optimistic type compilation framework, which contains all the mechanisms for quick code replacement and on stack replacement on the bytecode level, I will present the new execution architecture we are developing. It will minimizes compile time intelligently, while maintaining or possible even increasing code performance, due to extra profiling and execution frequency information being passed to the JIT. I will also talk about what the future will bring in terms of other dynamic languages on the Nashorn engine, partial method compilation of hot paths and other intriguing possibilities that our new execution model opens up.
This document introduces Failsafe, which provides latency and fault tolerance capabilities for distributed systems. It discusses how Failsafe compares to Hystrix and how it is used at Coupang. Key features of Failsafe include retry policies, circuit breakers, fallbacks, and asynchronous execution. Event listeners and policy composition patterns are also covered.
The document discusses testing asynchronous Node.js code. It describes the current approach of using callbacks in tests but notes issues with this approach. It then discusses using stubs and mocks to make asynchronous code synchronous so it can be tested more easily. Finally, it discusses the benefits of writing many small "microtests" that isolate and test individual functions and paths through the code rather than large integration tests.
This document discusses the development of Apache Pig on Tez, an execution engine for Pig jobs. Pig on Tez allows Pig workflows to be executed as directed acyclic graphs (DAGs) using Tez, improving performance over the default MapReduce execution. Key benefits of Tez include eliminating intermediate data writes, reducing job launch overhead, and allowing more flexible data flows. However, challenges remain around automatically determining optimal parallelism and integrating Tez with user interface and monitoring tools. Future work is needed to address these issues.
Ehcache 3: JSR-107 on steroids at Devoxx MoroccoLouis Jacomet
The document summarizes Louis Jacomet's presentation on Ehcache 3. Some key points:
- Ehcache 3 is based on JSR-107 and improves on caching APIs and semantics. It supports explicit lifecycles, proper typing for caches, and custom serialization.
- Ehcache 3 enables cache-through and write-behind patterns to integrate caching with databases. It allows caching and persisting data across multiple tiers including heap, disk, and clustered storage.
- New features in Ehcache 3 include eviction veto/prioritization, transactions, automatic resource control, and resilience strategies to handle storage and timeout failures. Clustering is implemented using Terracotta.
This document summarizes a presentation about the future of the Rake gem and domain-specific languages (DSLs) in Ruby.
The presentation discusses:
1. How Rake works as a Make-like program implemented in Ruby syntax with tasks and dependencies. Rake files use standard Ruby syntax.
2. Examples of common patterns for building internal DSLs in Ruby using class/module methods, method definition, implicit/explicit code blocks, and instance evaluation.
3. How popular Ruby gems like Rake, Bundler, and Thor use DSL techniques and inherit from each other to provide domain-specific interfaces.
When performance hits rock-bottom everybody (and their dog) is called upon and all of a sudden developers should have been responsible for last half a year or so and code with performance in mind (and deadlines, but that of course goes unsaid). So, here I'm talking about what can a dev do to meet those unreasonable demands) and what might he do anticipating them.
Strictly JVM, mostly Sun Hotspot impl, but number of points can be used to other JVMs as wel
A brief look at a few IP cameras, wireless extenders and routers - a significant number have unpatched issues such as cross-site scripting, cross-site request forgery and authentication bypass, meaning we can take control of devices, change wireless settings and obtain a copy of all video on certain devices, all by having the unsuspecting user visit a web page we control.
Новый InterSystems: open-source, митапы, хакатоныTimur Safin
Presentation for the 1st InterSystems Meetup in the Minsk:
- New and better InterSystems changes their practice.
- open-source repositories, meetups, and hackathon;
- CPM (package manager) as a good example of open-source project
How to run system administrator recruitment process? By creating platform based on open source parts in just 2 nights! I gave this talk in Poland / Kraków OWASP chapter meeting on 17th October 2013 at our local Google for Entrepreneurs site. It's focused on security and also shows how to create recruitment process in CTF / challenge way.
This story covers mostly security details of this whole platform. There's great chance, that I will give another talk about this system but this time focusing on technical details. Stay tuned ;)
Experiments in Sharing Java VM Technology with CRubyMatthew Gaudet
IBM is developing a just-in-time (JIT) compiler called Testarossa based on its Open Runtime (OMR) toolkit. The goal is to integrate the JIT compiler into MRI Ruby to improve performance without changing how MRI works. So far, the JIT supports most opcodes and can run Rails applications, but performance gains are modest. IBM hopes to collaborate with the Ruby community to further optimize Ruby and help make it faster.
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.
JRuby allows running Ruby code on the Java Virtual Machine. It has the advantages of accessing Java libraries from Ruby and embedding Ruby in Java applications. Gems mostly work the same in JRuby as Ruby MRI, though some with native extensions may need alternatives. ActiveRecord can use JDBC drivers in JRuby to connect to databases. Converting Rails apps may require updating gems to specify platforms. JRuby is well-suited for deployment on Java application servers using WAR files generated by the Warbler gem.
The document discusses challenges in implementing the Ruby programming language on the Java Virtual Machine (JVM) using JRuby. It covers areas like parsing Ruby, implementing different interpreters and compilers, utilizing JVM tricks, ensuring compatibility with features like strings and fibers, and integrating native capabilities. The author also shares decisions they have made around these challenges and future work.
6 reasons Jubilee could be a Rubyist's new best friendForrest Chang
(Video here: http://confreaks.com/videos/5014-RubyConf2014-6-reasons-jubilee-could-be-a-rubyist-s-new-best-friend or https://www.youtube.com/watch?feature=player_embedded&v=FFR0G89WXI8)
Rubyconf 2014 talk on Jubilee, a Vert.x module that runs rack apps.
Alternate titles
Beyond Rails while using Rails
Rails can't do everything I want and <fill> makes me want to cry
Rubyconf abstract
Do you do web development in Ruby? Have you been forced to go to node or other technologies just for concurrency/websockets etc. Do miss your gems, and tire of functionality you have to implement from scratch? Do you hate javascript?
Well no need to switch languages/platforms, Jubilee could be your new best friend.
Jubilee, a rack server on top of Vert.x gives you
* Concurrency
* Speed
* Easy Websockets support
* Shared Memory
* Access to the JVM ecosystem
* Ability to reuse your existing Ruby knowledge and gems
"Say Hello to your new friend" - Al Pacino
JRuby allows running Ruby code on the Java Virtual Machine. This provides access to Java libraries and enables deployment of Ruby/Rails applications as Java web archives for easier hosting. Integrating Rails with JRuby requires plugins like ActiveRecord-JDBC for database access. Performance is currently lower than native Ruby but may improve as JVM optimizations emerge. Full Ruby compatibility remains challenging due to differences from the JVM environment.
This document summarizes the experiences of operating Rails websites at stable scale. It discusses using virtualization to run multiple websites on a single server. It provides tips for optimizing performance including database tuning, adding indexes, log rotation, and restarting Mongrel processes periodically. New Rails sites are launched using the newest framework versions and different web servers like Passenger are tested for performance.
An overview of Ruby, jRuby, Rails, Torquebox, and PostgreSQL that was presented as a 3 hour class to other programmers at The Ironyard (http://theironyard.com) in Greenville, SC in July of 2013. The Rails specific sections are mostly code samples that were explained during the session so the real focus of the slides is Ruby, "the rails way" / workflow / differentiators and PostgreSQL.
This document summarizes a presentation about JRuby, an implementation of the Ruby programming language that runs on the Java Virtual Machine. It discusses what JRuby is, how to get started with it, details of its implementation including compilation and threading, and how it addresses various issues with Ruby like performance, memory management, and integration with Java. It also covers some JRuby projects and potential future directions.
Top 5 Mistakes to Avoid When Writing Apache Spark ApplicationsCloudera, Inc.
The document discusses 5 common mistakes people make when writing Spark applications:
1) Not properly sizing executors for memory and cores.
2) Having shuffle blocks larger than 2GB which can cause jobs to fail.
3) Not addressing data skew which can cause joins and shuffles to be very slow.
4) Not properly managing the DAG to minimize shuffles and stages.
5) Classpath conflicts from mismatched dependencies causing errors.
Top 5 Mistakes When Writing Spark Applications by Mark Grover and Ted MalaskaSpark Summit
The document discusses 5 common mistakes people make when writing Spark applications:
1) Not properly sizing executors for memory and cores.
2) Having shuffle blocks larger than 2GB which can cause jobs to fail.
3) Not addressing data skew which can cause joins and shuffles to be very slow.
4) Not properly managing the DAG to minimize shuffles and stages.
5) Classpath conflicts from conflicting dependencies like Guava which can cause errors.
Top 5 mistakes when writing Spark applicationsmarkgrover
This is a talk given at Advanced Spark meetup in San Francisco (http://www.meetup.com/Advanced-Apache-Spark-Meetup/events/223668878/). It focusses on common mistakes when writing Spark applications and how to avoid them.
This document provides an overview of JRuby, an implementation of the Ruby programming language that runs on the Java Virtual Machine (JVM). It discusses key features of JRuby including its compiler, core class implementations, threading model, and performance improvements compared to other Ruby implementations. The document also outlines several JRuby projects that integrate Ruby and Java such as JRuby on Rails, JtestR, and Ruvlets.
This document provides tips and best practices for optimizing Apache Spark performance and resource allocation. It discusses:
- The components of Spark including executors, drivers, and tasks
- Configuring Spark on YARN and dynamic resource allocation
- Optimizing memory usage, avoiding data skew, and reducing serialization costs
- Best practices for Spark Streaming around microbatching, fault tolerance, and performance
- Recommendations for running Spark on cloud object stores like S3
The document discusses JRuby, a Java implementation of the Ruby programming language. It provides an overview of JRuby and its benefits compared to MRI Ruby, including native threading, Unicode support, performance improvements from just-in-time compilation, better memory management from Java's garbage collection, and easier integration with existing Java libraries and enterprise infrastructure. Examples are given of ThoughtWorks projects like Mingle that use JRuby on Rails to take advantage of these benefits.
jRuby fixes some issues with the Ruby programming language like memory leaks and lack of kernel level threading by running Ruby code on the Java Virtual Machine which has features like a sophisticated garbage collector, just-in-time compilation for improved performance, and native threading; benchmarks show jRuby provides much higher concurrency and better performance than Ruby for background processing and web applications; deploying a Ruby application using jRuby and a Java application server like Torquebox allows it to take advantage of the reliability, scalability and deployment features of the Java platform.
Redis Day Keynote Salvatore Sanfillipo Redis LabsRedis Labs
Redis' seventh birthday was recently celebrated with the community, several contributors and users. This is Salvatore's keynote as he kicked off Redis Day in Tel Aviv.
Secrets of Performance Tuning Java on KubernetesBruno Borges
Java on Kubernetes may seem complicated, but after a bit of YAML and Dockerfiles, you will wonder what all that fuss was. But then the performance of your app in 1 CPU/1 GB of RAM makes you wonder. Learn how JVM ergonomics, CPU throttling, and GCs can help increase performance while reducing costs.
Concurrency and Multithreading Demistified - Reversim Summit 2014Haim Yadid
Life as a software engineer is so exciting! Computing power continue to rise exponentially, software demands continue to rise exponentially as well, so far so good. The bad news are that in the last decade the computing power of single threaded application remains almost flat.
If you decide to continue ignoring concurrency and multi-threading the gap between the problems you are able to solve and your hardware capabilities will continue to rise. In this session we will discuss different approaches for taming the concurrency beast, such as shared mutability,shared immutability and isolated mutability actors, STM, etc we will discuss the shortcomings and the dangers of each approach and we will compare different programming languages and how they choose to tackle/ignore concurrency.
Angular 2 is a new version of AngularJS that is currently in alpha. It embraces modern web standards like Shadow DOM and Web Workers. Angular 2 components replace directives and use classes instead of controllers. Templates are now called views. Two-way binding and ng-repeat are changed. The API is still changing but you can try it now on angular.io.
Messaging, interoperability and log aggregation - a new frameworkTomas Doran
In this talk, I will talk about why log files are horrible, logging log lines, and more structured performance metrics from large scale production applications as well as building reliable, scaleable and flexible large scale software systems in multiple languages.
Why (almost) all log formats are horrible will be explained, and why JSON is a good solution for logging will be discussed, along with a number of message queuing, middleware and network transport technologies, including STOMP, AMQP and ZeroMQ.
The Message::Passing framework will be introduced, along with the logstash.net project which the perl code is interoperable with. These are pluggable frameworks in ruby/java/jruby and perl with pre-written sets of inputs, filters and outputs for many many different systems, message formats and transports.
They were initially designed to be aggregators and filters of data for logging. However they are flexible enough to be used as part of your messaging middleware, or even as a replacement for centralised message queuing systems.
You can have your cake and eat it too - an architecture which is flexible, extensible, scaleable and distributed. Build discrete, loosely coupled components which just pass messages to each other easily.
Integrate and interoperate with your existing code and code bases easily, consume from or publish to any existing message queue, logging or performance metrics system you have installed.
Simple examples using common input and output classes will be demonstrated using the framework, as will easily adding your own custom filters. A number of common messaging middleware patterns will be shown to be trivial to implement.
Some higher level use-cases will also be explored, demonstrating log indexing in ElasticSearch and how to build a responsive platform API using webhooks.
Interoperability is also an important goal for messaging middleware. The logstash.net project will be highlighted and we'll discuss crossing the single language barrier, allowing us to have full integration between java, ruby and perl components, and to easily write bindings into libraries we want to reuse in any of those languages.
Fast as C: How to Write Really Terrible JavaCharles Nutter
For years we’ve been told that the JVM’s amazing optimizers can take your running code and make it “fast” or “as fast as C++” or “as fast as C”…or sometimes “faster than C”. And yet we don’t often see this happen in practice, due in large part to (good and bad) development patterns that have taken hold in the Java world.
In this talk, we’ll explore the main reasons why Java code rarely runs as fast as C or C++ and how you can write really bad Java code that the JVM will do a better job of optimizing. We’ll take some popular microbenchmarks and burn them to the ground, monitoring JIT logs and assembly dumps along the way.
Have you ever used an open source project? Of course you have, but have you made any contributions yourself? Filed a bug report? Submitted a patch? Have you ever started your own OSS project, or taken a closed/private project public? What licenses should you use? How do you manage contributions? How do you encourage contributors and get work done? In this talk we'll go over the basics of OSS: how to get involved, how to start a project, how to manage contributions. We'll discuss project lifecycles, legal CYA tips, and how to keep projects moving. You'll see the inner workings of real OSS projects, and learn how to be a better OSS user and producer.
Presented at Jfokus 2015
InvokeBinder: Fluent Programming for Method HandlesCharles Nutter
The MethodHandle API provides a powerful way to build optimized function pointers that do a wide variety of call-path adaptations. Unfortunately, the API as designed requires mental contortions to write anything more than trivial handle chains by hand. Adaptations must be made backwards from the target, argument-list modifications are done by index and length, and debugging failed adaptations can be a terrific challenge. InvokeBinder seeks to make method handles fun and easy to use by providing a fluent API, building adaptations from the call forward, allowing argument-list manipulation by name and wildcard, and much more. We'll explore everything InvokeBinder does today and talk about improvements for the future.
JRuby 9000 represents the biggest-ever leap forward for JRuby. Not only have we caught up on compatibility (9000 will be 2.2-compatible from release), but we've completely redesigned our JVM-based runtime and have opened our codebase up to the JRuby+Truffle research project from Oracle Labs. The changes we've made will make it easier to keep up with MRI on compatibility and give us the potential to run Ruby as fast as Java or C. The entire Ruby world will change over the next year, and JRuby 9000 will be leading the way. We'll talk about what Ruby's going to look like once JRuby is "over 9000".
Have you ever used an open source project? Well of course you have, but how about contributed to one? Filed a bug report? Submitted a patch? Have you ever started your own OSS project, or taken a closed/private project public? What licenses should you use? How do you manage contributions? How do you encourage contributors and get work done? In this talk we'll go over the basics of OSS: how to get involved, how to start a project, how to manage contributions. We'll discuss project lifecycles, legal CYA tips, and how to keep projects moving. You'll see the inner workings of real OSS projects, and learn how to be a better OSS user and producer.
Bringing Concurrency to Ruby - RubyConf India 2014Charles Nutter
The document discusses bringing concurrency to Ruby. It begins by defining concurrency and parallelism, noting that both are needed but platforms only enable parallelism if jobs can split into concurrent tasks. It reviews concurrency and parallelism in popular Ruby platforms like MRI, JRuby, and Rubinius. The document outlines four rules for concurrency and discusses techniques like immutable data, locking, atomics, and specialized collections for mutable data. It highlights libraries that provide high-level concurrency abstractions like Celluloid for actors and Sidekiq for background jobs.
The document discusses strategies for improving the startup performance of JRuby. It describes how the JRuby team optimized startup by using a Java-heavy JDK instead of native code, tweaking JVM flags, and implementing Drip - a technique that pre-boots the JVM and caches runtime configurations between runs. Drip reduced JRuby startup times from over 10 seconds to under 1 second for many common tasks. Later, it discusses challenges with JNI and how the Java Native Runtime (JNR) provides a better alternative for interfacing Java with native code and libraries.
This document provides an overview of upcoming technologies beyond the Java Virtual Machine (JVM). It begins with introductions and then discusses several topics:
- There are many open-source JVMs beyond Oracle's HotSpot such as JamVM, Maxine, and JikesRVM.
- Reasons for using the JVM include its large standard library and ease of portability compared to alternative virtual machines. However, startup time can be slow.
- Techniques for improving JVM startup time are discussed, such as saving JIT-compiled code and using the Drip tool to pre-initialize JVMs.
- Native interoperability is explored through the Java Native Interface (JNI
This document provides an overview of upcoming technologies related to the Java Virtual Machine (JVM). It begins with introductions and goals of the talk. It then discusses what the JVM is and lists many open-source JVMs. Next it explores reasons for and against using the JVM. A timeline of the OpenJDK project is presented. Features of Java 7 and 8 are highlighted. Alternative languages that run on the JVM are listed. Native interoperability via JNI and the Java Native Runtime (JNR) are described. Performance of JNR compared to JNA is shown.
The document discusses exploring interesting Java features and how they are compiled and executed by the Java Virtual Machine (JVM). It begins with an introduction and overview of the topics that will be covered, including looking at Java bytecode, compiler logs, and generated native code. Examples of simple "Hello World" and math programs are provided and their compilation steps are examined at the bytecode, logging and native code levels to demonstrate how Java code is handled by the JVM.
The document discusses JRuby, a Ruby implementation that runs on the Java Virtual Machine. It provides an introduction to JRuby, describing how it allows Ruby code to leverage Java libraries and run on the JVM. It also discusses some of the challenges of implementing Ruby on the JVM, such as performance optimization, and outlines JRuby's approach to addressing issues like concurrency through libraries that provide thread-safe data structures.
The document discusses invokedynamic, a new bytecode introduced in Java 7 that allows for user-definable bytecode behavior. It provides more flexibility compared to the traditional bytecode instructions like invokevirtual. invokedynamic calls a bootstrap method that prepares a CallSite object and MethodHandle to invoke the target method. This allows dynamic dispatch, fast method pointers, and optimizable behavior like normal Java code. The document includes examples of using invokedynamic to implement dynamic language features and define new domain-specific languages.
This document summarizes Charles Nutter's involvement with JSR 292 (invokedynamic) and JRuby performance over several years. It describes early experiments adding invokedynamic support to JRuby in 2008-2009 before the Java 7 implementation. After Java 7's release, performance was still much slower than regular calls. The document lists efforts by Nutter and the Hotspot team from 2010-2011 to improve performance through JIT optimizations and other changes. It discusses options for dealing with invokedynamic's poor performance in Java 7 and monitoring future JVM versions for improvements.
JRuby is a Ruby implementation that runs on the Java Virtual Machine (JVM). It allows Ruby code to leverage Java libraries and frameworks and enables deployment on JVM platforms like Android. The JRuby team maintains and improves JRuby, but much of the underlying infrastructure like memory management, threading, and JIT compilation is provided by the JVM, allowing the team to focus on Ruby-specific aspects. JRuby can be used on many platforms and provides access to Java libraries and frameworks, enabling applications to leverage large Java ecosystems.
High Performance Ruby - Golden Gate RubyConf 2012Charles Nutter
Hotspot optimizes the first loop in the benchmark and inlines the method calls. When the second loop with different method calls is encountered, Hotspot's assumptions change and performance is negatively impacted. Monitoring the JVM's optimization activities like JIT compilation and inlining is needed to better understand benchmark results, as small code behaves differently than large code during optimization.
Invokedynamic allows for more dynamic method dispatch at runtime. It works by adding a new bytecode called invokedynamic that defers method lookup to a bootstrap method specified by the developer. This gives developers control over how methods are looked up and invoked, enabling use cases like dynamic language implementation, lazy constants, delegates, multi-dispatch, and more. Languages like JRuby have seen significant performance improvements by using invokedynamic.
HCL Notes and Domino License Cost Reduction in the World of DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-and-domino-license-cost-reduction-in-the-world-of-dlau/
The introduction of DLAU and the CCB & CCX licensing model caused quite a stir in the HCL community. As a Notes and Domino customer, you may have faced challenges with unexpected user counts and license costs. You probably have questions on how this new licensing approach works and how to benefit from it. Most importantly, you likely have budget constraints and want to save money where possible. Don’t worry, we can help with all of this!
We’ll show you how to fix common misconfigurations that cause higher-than-expected user counts, and how to identify accounts which you can deactivate to save money. There are also frequent patterns that can cause unnecessary cost, like using a person document instead of a mail-in for shared mailboxes. We’ll provide examples and solutions for those as well. And naturally we’ll explain the new licensing model.
Join HCL Ambassador Marc Thomas in this webinar with a special guest appearance from Franz Walder. It will give you the tools and know-how to stay on top of what is going on with Domino licensing. You will be able lower your cost through an optimized configuration and keep it low going forward.
These topics will be covered
- Reducing license cost by finding and fixing misconfigurations and superfluous accounts
- How do CCB and CCX licenses really work?
- Understanding the DLAU tool and how to best utilize it
- Tips for common problem areas, like team mailboxes, functional/test users, etc
- Practical examples and best practices to implement right away
OpenID AuthZEN Interop Read Out - AuthorizationDavid Brossard
During Identiverse 2024 and EIC 2024, members of the OpenID AuthZEN WG got together and demoed their authorization endpoints conforming to the AuthZEN API
GraphRAG for Life Science to increase LLM accuracyTomaz Bratanic
GraphRAG for life science domain, where you retriever information from biomedical knowledge graphs using LLMs to increase the accuracy and performance of generated answers
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
Webinar: Designing a schema for a Data WarehouseFederico Razzoli
Are you new to data warehouses (DWH)? Do you need to check whether your data warehouse follows the best practices for a good design? In both cases, this webinar is for you.
A data warehouse is a central relational database that contains all measurements about a business or an organisation. This data comes from a variety of heterogeneous data sources, which includes databases of any type that back the applications used by the company, data files exported by some applications, or APIs provided by internal or external services.
But designing a data warehouse correctly is a hard task, which requires gathering information about the business processes that need to be analysed in the first place. These processes must be translated into so-called star schemas, which means, denormalised databases where each table represents a dimension or facts.
We will discuss these topics:
- How to gather information about a business;
- Understanding dictionaries and how to identify business entities;
- Dimensions and facts;
- Setting a table granularity;
- Types of facts;
- Types of dimensions;
- Snowflakes and how to avoid them;
- Expanding existing dimensions and facts.
Programming Foundation Models with DSPy - Meetup SlidesZilliz
Prompting language models is hard, while programming language models is easy. In this talk, I will discuss the state-of-the-art framework DSPy for programming foundation models with its powerful optimizers and runtime constraint system.
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Speck&Tech
ABSTRACT: A prima vista, un mattoncino Lego e la backdoor XZ potrebbero avere in comune il fatto di essere entrambi blocchi di costruzione, o dipendenze di progetti creativi e software. La realtà è che un mattoncino Lego e il caso della backdoor XZ hanno molto di più di tutto ciò in comune.
Partecipate alla presentazione per immergervi in una storia di interoperabilità, standard e formati aperti, per poi discutere del ruolo importante che i contributori hanno in una comunità open source sostenibile.
BIO: Sostenitrice del software libero e dei formati standard e aperti. È stata un membro attivo dei progetti Fedora e openSUSE e ha co-fondato l'Associazione LibreItalia dove è stata coinvolta in diversi eventi, migrazioni e formazione relativi a LibreOffice. In precedenza ha lavorato a migrazioni e corsi di formazione su LibreOffice per diverse amministrazioni pubbliche e privati. Da gennaio 2020 lavora in SUSE come Software Release Engineer per Uyuni e SUSE Manager e quando non segue la sua passione per i computer e per Geeko coltiva la sua curiosità per l'astronomia (da cui deriva il suo nickname deneb_alpha).
Your One-Stop Shop for Python Success: Top 10 US Python Development Providersakankshawande
Simplify your search for a reliable Python development partner! This list presents the top 10 trusted US providers offering comprehensive Python development services, ensuring your project's success from conception to completion.
Taking AI to the Next Level in Manufacturing.pdfssuserfac0301
Read Taking AI to the Next Level in Manufacturing to gain insights on AI adoption in the manufacturing industry, such as:
1. How quickly AI is being implemented in manufacturing.
2. Which barriers stand in the way of AI adoption.
3. How data quality and governance form the backbone of AI.
4. Organizational processes and structures that may inhibit effective AI adoption.
6. Ideas and approaches to help build your organization's AI strategy.
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfChart Kalyan
A Mix Chart displays historical data of numbers in a graphical or tabular form. The Kalyan Rajdhani Mix Chart specifically shows the results of a sequence of numbers over different periods.
Ivanti’s Patch Tuesday breakdown goes beyond patching your applications and brings you the intelligence and guidance needed to prioritize where to focus your attention first. Catch early analysis on our Ivanti blog, then join industry expert Chris Goettl for the Patch Tuesday Webinar Event. There we’ll do a deep dive into each of the bulletins and give guidance on the risks associated with the newly-identified vulnerabilities.
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Introduction of Cybersecurity with OSS at Code Europe 2024Hiroshi SHIBATA
I develop the Ruby programming language, RubyGems, and Bundler, which are package managers for Ruby. Today, I will introduce how to enhance the security of your application using open-source software (OSS) examples from Ruby and RubyGems.
The first topic is CVE (Common Vulnerabilities and Exposures). I have published CVEs many times. But what exactly is a CVE? I'll provide a basic understanding of CVEs and explain how to detect and handle vulnerabilities in OSS.
Next, let's discuss package managers. Package managers play a critical role in the OSS ecosystem. I'll explain how to manage library dependencies in your application.
I'll share insights into how the Ruby and RubyGems core team works to keep our ecosystem safe. By the end of this talk, you'll have a better understanding of how to safeguard your code.
Have you ever been confused by the myriad of choices offered by AWS for hosting a website or an API?
Lambda, Elastic Beanstalk, Lightsail, Amplify, S3 (and more!) can each host websites + APIs. But which one should we choose?
Which one is cheapest? Which one is fastest? Which one will scale to meet our needs?
Join me in this session as we dive into each AWS hosting service to determine which one is best for your scenario and explain why!
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
Main news related to the CCS TSI 2023 (2023/1695)Jakub Marek
An English 🇬🇧 translation of a presentation to the speech I gave about the main changes brought by CCS TSI 2023 at the biggest Czech conference on Communications and signalling systems on Railways, which was held in Clarion Hotel Olomouc from 7th to 9th November 2023 (konferenceszt.cz). Attended by around 500 participants and 200 on-line followers.
The original Czech 🇨🇿 version of the presentation can be found here: https://www.slideshare.net/slideshow/hlavni-novinky-souvisejici-s-ccs-tsi-2023-2023-1695/269688092 .
The videorecording (in Czech) from the presentation is available here: https://youtu.be/WzjJWm4IyPk?si=SImb06tuXGb30BEH .
2. Hello!
• Charles Oliver Nutter
• headius@headius.com, @headius
• JVM language advocate at Red Hat
• 20-year JVM veteran, 12 years on
JRuby
• Excited to be back in Kyiv!
3. The JRuby Guys
• Shout out to my buddy Tom Enebo
• Just presented at RubyKaigi in
Sendai, Japan
• We've worked together on JRuby for
over 12 years!
4. Beer For You!
• I am a beer lover!
• I brought some American craft
beers to give away!
• Try running something on JRuby,
show me, and take your pick:
• Bender: oatmeal brown ale
• Furious: dark American IPA
• Foggy Geezer: New England IPA
5.
6.
7. What is JRuby
• It's just Ruby!
• Ruby 2.5 compatible, if something's broken tell us
• Supports pure-Ruby gems, many extensions
• We want to be a Ruby first!
• It's a JVM language
• Full access to the power of the JVM platform!
8. Ruby!
• JRuby 9.2 is now Ruby 2.5 compatible
• Modulo a few things we couldn't finish
• You won't notice unless you use some weird edge features
• Primary focus is always on compatibility and experience
• Performance comes along later
10. JRuby 9.2
• Ruby 2.5, of course
• Better support for non-ASCII identifiers
• Method names, constants, symbols...
• Keyword arguments optimizations
• Preparing for new optimizations and JVMs
11. Supporting Ruby Versions
• Checklist based off CRuby's NEWS file
• Update our copy of CRuby's tests and make them pass
• Same process for ruby/spec, our own tests, and key libraries
12. New Feature? You Can Help!
• New features are great opportunities to contribute!
• Learn more about how Ruby and JRuby work!
• Help us keep up with Ruby development!
• Profit!
• We are always standing by on IRC, Gitter, Twitter to help you
13. Library Compatibility
• We also run library tests
• Rails, Rake, RubyGems, ...
• Core Ruby tests will never cover 100% of users
• Rails in particular is a key target
15. JRuby Architecture
• Mixed-mode runtime
• Interpreter runs for a while, gathering information
• Just-in-time (JIT) compiler compiles hot code to JVM
• JVM turns that into optimized native code
• Heavy dependence on JVM to optimize well
• Newer JVM JITs showing great promise!
17. Microbenching
• Very fun to show off, see improve
• Practically useless
• Like judging a person by how much they can bench press
• JRuby has won microbenchmarks for years, never faster on Rails
• Easier to isolate specific measurements
• Great for exploring new runtimes and tech
18. bench_aref
• Testing calls to ary[n]
• Reduced overhead in JRuby 9.2
• String#[] needs to store $~
• We have to track that just in case ary is a String
• JRuby 9.1 deoptimized more than necessary
19. require 'benchmark/ips'
@a = [1]
def foo(a)
a[0]
end
Benchmark.ips do |x|
x.time = 10
x.warmup = 15
x.report("Instantiation") {
a = @a
i = 0; while i < 1_000_000; foo(a); i += 1; end
}
end
20. bench_aref iterations per second (higher is better)
0 iter/s
10 iter/s
20 iter/s
30 iter/s
40 iter/s
JDK10
JRuby 9.1 JRuby 9.2
39.132
30.248
21. InvokeDynamic
• JVM support for dynamic invocation
• Let the JVM see through all the dynamic bits of Ruby
• Added in Java 7, with much input and testing from JRuby
• Steadily improving performance, reducing overhead
• -Xcompile.invokedynamic
• May be default soon!
22. bench_aref iterations per second (higher is better)
0 iter/s
22.5 iter/s
45 iter/s
67.5 iter/s
90 iter/s
JDK10 JDK10 with Indy
JRuby 9.1 JRuby 9.2 JRuby 9.1 JRuby 9.2
89.169
39.132
68.122
30.248
23. Graal
• New JVM native JIT written in Java
• Faster evolution
• More advanced optimization
• Plugs into JDK9+ via command line flags
• Shipped with JDK10...try it today!
24. bench_aref iterations per second (higher is better)
0 iter/s
45 iter/s
90 iter/s
135 iter/s
180 iter/s
JDK10 JDK10 with Indy JDK10 Graal with Indy
JRuby 9.1 JRuby 9.2 JRuby 9.1 JRuby 9.2 JRuby 9.1 JRuby 9.2
172.541
89.169
39.132
100.401
68.122
30.248
25. bench_mandelbrot
• Generate a text Mandelbrot fractal
• See? Useful!
• Test of numeric performance
• Heavy reliance on JVM to optimize
• Graal is especially good to us here
26. bench_mandelbrot.rb
def mandelbrot(size)
sum = 0
byte_acc = 0
bit_num = 0
y = 0
while y < size
ci = (2.0*y/size)-1.0
x = 0
while x < size
zrzr = zr = 0.0
zizi = zi = 0.0
cr = (2.0*x/size)-1.5
escape = 0b1
z = 0
while z < 50
27. bench_mandelbrot total execution time (lower is better)
0s
1s
2s
3s
4s
CRuby 2.5 CRuby 2.6 JIT JRuby JRuby Indy JRuby Indy Graal
0.139s
1.33s
2.95s
3.5s3.57s
33. A Long, Hard Journey
• JRuby first ran Rails in 2006
• Almost as long as Rails has existed!
• Thousands of JRoR instances around the world
• JRuby 9000, Ruby 2.4, 2.5 work slowed down Rails support
• Rails 5.0 not supported for at least a year
• ActiveRecord suffered the most
34. ActiveRecord JDBC
• ActiveRecord atop Java DataBase Connectivity API
• No C extensions, no -devel packages, no headers or compiling
• Rebooted last year to reduce maintenance hassle
• 1:1 match with Rails versions (e.g. Rails 5.1 = ARJDBC 51.x)
• SQLite3, MySQL/Maria, PostgreSQL
• Sharing 90%+ of code with Rails
35. Example: MySQL support
• Old adapter: 1600+ lines of Ruby code
• 50.0 adapter: 284 lines
• More can be removed, moved into Rails
• Reduced Java/JDBC code as well
• 51.0 adapter: only 6 lines had to change!
42. ActiveRecord Performance
• Rails apps live and die by ActiveRecord
• Largest CPU consumer by far
• Heavy object churn, GC overhead
• Create, read, and update measurements
• If delete is your bottleneck, we need to talk
• CRuby 2.5.1 vs JRuby 9.2 on JDK10
48. Scaling Rails
• Classic problem on MRI
• No concurrent threads, so we need processes
• Processes inevitably duplicate runtime state
• Much effort and lots of money wasted
• JRuby is a great answer!
• Multi-threaded single process runs your whole site
49. Measuring Rails Performance
• Requests per second
• ActiveRecord operations per second
• CRuby versus JRuby, various configurations
50. Requests Per Second
• Rails 5.1.6, Postgresql 10, scaffolded view
• 4k requests to warm up, then measure every 10k
• EC2 c4.xlarge: 4 vCPUs, 7.5GB
• Bench, database, and app on same instance
51. Requests per second, full stack scaffolded read on Postgresql
0
325
650
975
1300
JRuby JDK8 Indy JRuby JDK10 Indy CRuby
53. JRuby on Rails Memory
• Single instance is much bigger, 400-500MB versus 50MB
• Ten CRuby processes = 500MB
• Ten JRuby threads = 400-500MB
• May need to tell JVM a memory cap
• For 100-way or 1000-way...you do the math
54. JRuby is the fastest way
to run Rails applications.
57. JRuby Flags
• -Xcompile.invokedynamic
• Enable the use of JVM's InvokeDynamic feature
• Faster straight-line perf, maybe slower startup/warmup
• -Xfixnum.cache=false
• Disable caching -256..256 Fixnum objects to help Graal
• --dev for improved startup time (disables optimization)
58. Getting Graal
• Download JDK10, it's in there
• -XX:+UnlockExperimentalVMOptions
-XX:+EnableJVMCI
-XX:+UseJVMCICompiler
• Put in JAVA_OPTS or prefix with -J at JRuby CLI
• Download "GraalVM" as your JDK
• Commercial product, but maybe that's your thing
59. JDK10 Warnings
• JDK9 introduced stricter encapsulation
• We poke through that encapsulation to support Ruby features
• You'll see warnings...they're harmless, but we'll deal with them
60.
61. Thank You!
Charles Oliver Nutter
headius@headius.com
@headius
http://jruby.org
https://github.com/jruby/jruby