Topics

Featured in Development

Peter Alvaro talks about the reasons one should engage in language design and why many of us would (or should) do something so perverse as to design a language that no one will ever use. He shares some of the extreme and sometimes obnoxious opinions that guided his design process.

Featured in AI, ML & Data Engineering

Today on The InfoQ Podcast, Wes talks with Katharine Jarmul about privacy and fairness in machine learning algorithms. Jarul discusses what’s meant by Ethical Machine Learning and some things to consider when working towards achieving fairness. Jarmul is the co-founder at KIProtect a machine learning security and privacy firm based in Germany and is one of the three keynote speakers at QCon.ai.

Featured in Culture & Methods

Organizations struggle to scale their agility. While every organization is different, common patterns explain the major challenges that most organizations face: organizational design, trying to copy others, “one-size-fits-all” scaling, scaling in siloes, and neglecting engineering practices. This article explains why, what to do about it, and how the three leading scaling frameworks compare.

JRuby-Prof is a new JRuby specific profiler by Daniel Lucraft. While there are many mature profilers for Java available, JRuby's mixed execution mode makes their output hard to read; some JRuby code is interpreted, some JRuby hot spots are JIT compiled to bytecode. With a Java profiler, JRuby's internal methods will show up in the profiles, hogging all the top spots in the profile output, when the user actually only wants to know how often which Ruby methods are invoked.

JRuby-prof uses JRuby's hooks to get information about events like method invocation, etc. Hooks are a more efficient way of implementing a profiler, at least compared to the simple method of set_trace_func, where a callback function is called before a line is executed.

After talking with MenTaLguY on IRC about adding some concurrent collections to JRuby, we came up with a new feature for people to try out: require 'jruby/synchronized'
class MyClass include JRuby::Synchronized ...
or obj.extend JRuby::Synchronized

the effect of including or extending this new module is that all method calls against that class's object (or against that now-singleton object) will act like they're wrapped in a Java synchronized block. No two threads will be able to execute methods against those objects at the same time (on a per-object basis, obviously).

It's an experiment with providing concurrency tools for JRuby - what others would you like to see?

Community comments

Not all Java Profilers are equal

Your message is awaiting moderation. Thank you for participating in the discussion.

"With a Java profiler, JRuby's internal methods will show up in the profiles, hogging all the top spots in the profile output, when the user actually only wants to know how often which Ruby methods are invoked."

This is not entirely true. There are Java profiling (metering) solutions Ruby/JRuby aware.