We seem to be missing a good set of macro benchmarks for Ruby (and Rails). We have isrubyfastyet.com, which tries to benchmark simple Rails application but doesn't track JRuby / RBX very well and it's benchmarks could be improved. We have http://jruby.org/bench9000/ which is a set of micro benchmark.
I am excited about https://rubybench.org/ and the support for it by RubyTogether.org.
@headius, are you guys involved in this effort as well?
I'm seeing a small but statistically significant speedup of around 4% compared to 2.2.3, but 2.2.3 was down compared to 2.1.7 and we still haven't made the difference up yet.
These are my benchmarks, you may care about other benchmarks etc etc
It's '2.3.0', or '2.3' btw, never '2.30', which would be a release way in the future.
You can still use JRuby and generally have real threads. :-)
Also, the JVM is a remarkable piece of software; for example, as far as I can see, it contains one of the best garbage collectors around. And Java as a language has made some serious progress towards more readable code with less boilerplate (lambdas etc.).
Actually, creating desktop apps is easy and fun. I was able to churn out semi-professional looking UIs with Java SDK 1.1 back in the 90s. You can also create GTK/Qt apps with ease in Perl, Python, Ruby. One can create AWT/Swing apps using JRuby or Jython. There's also RubyMotion which allows you to write iOS apps in Ruby and compile them down to ObjC.
Desktop UI toolkits take care of the layout/styling for you, and provide a complete OOP representation of the UI.
Why not JRuby? Now with 1.7.0, JRuby can fully leverage the new InvokeDynamic JVM instruction.
Also, the frontend is still Rails, the backend message queue is a mix of Scala and pure-Java.
> Now, failed stat's are not the entire reason require is slow, but if I am reading the timestamps correctly in the strace log, they are a fair amount of it, and the most obviously wasteful thing.
A lesson to learn from the past that gets lost in all the shit-talking: This is why optcode caching developed in PHP. The rise of PHP frameworks like Kohana would not have happened without alleviating the stress a bunch of empty file stats cause when searching for includes. Toss a bunch of complex DB queries on that and yeah, you've got the shitty performance from PHP for complexities in 2003 all over again. Even Ruby is learning this lesson with projects like jRuby, which is essentially optcode caching inside a JVM.
To be fair though, it's not require() itself that's slow - it's file i/o. Perhaps your tool chain is doing more of that than it should via require(), but that's something the developers of those modules should keep in mind when writing their modules. Keep things lean with fewer secondary dependencies and things are nice and fast. Also, if you're shipping a production module, please make a fully minified and concatenated version.
Personally, I think this is the main reason to avoid large, swiss-army-knife, do-it-all frameworks. In some ways you made the choice in convenience over speed. Good luck to you.
It is just a ruby interpreter written for the JVM. In other words it translates ruby code to JVM bytecode so that the JVM can run it. This tends to give pretty bad startup times so it's terrible for short living ruby scripts, however for long running tasks you get the benefit of real threads and the impressive JIT compiling of the JRE.
For the most part you just write ruby. There are only a few catches (like some gems which use c extensions may not be an option, you have to use special gems to talk to a database rather than those you may be used to, etc). But mostly just write ruby and run in on the JVM. If you use rvm it's as easy as rvm install jruby.
The takeaway I get from this (and from real-world experience) is that MRI C/Ruby is the source of many bottlenecks. If you're doing Ruby and you need proper multithreading, you almost certainly need to be on the JVM. I see a bright future for JRuby 9000.
No. Thats apples and oranges.
I think that the community resources available for someone learning ruby are better than those for learning perl. The ruby community seems faster to adapt to new trends and ideas.
Plus you have projects like jruby. Ruby on the JVM useable in production.
Or products like Ruby Motion which converts ruby code into native IOS code allowing you to write native IOS apps in ruby.
I'm not trying to start a holy war or say that one language is better than the other. That type of thinking is counter productive. Perl is a great language.
This is just my perspective from having spent some time in both communities.
Highlights:
Driven by JRuby 9010, Torquebox, the Roda web framework, Sequel, PostgreSQL, Redis and Elasticsearch.
As a Rubyist (among other languages) who hasn't yet written a line of Crystal, that's an easy question.
Crystal exists now. Rails 3 will likely exist next year, and may well include some form of type hinting or annotation (whatever "soft typing" means). Personally, I think the most exciting news for Rubyists isn't Crystal, or even the hype around what might be in Ruby 3, but rather is something that also exists right now: JRuby 9.0.0.0 has been released. Multithreaded, performant code in modern Ruby just got practical.
> Also, are there any books/resources that can be used in order to practice and/or solve problems using Java and Ruby in order test my knowledge of these languages?
JRuby is an implementation of the Ruby programming language atop the Java Virtual Machine, written largely in Java.
Looks like JRuby may not support stdlib OpenSSL out of the box -- but it may be more becuase of export restrictions than anything else? http://jruby.org/openssl (not sure how outdated that message is though)
https://github.com/jruby/jruby-openssl is, I think, the jruby stdlib openssl compatibility support, and looks like it uses a third-party Java implementation of OpenSSL API. https://github.com/jruby/jruby-openssl/tree/master/src/main/java/org/jruby/ext/openssl I have no idea how performant it is, but it doesn't seem like it should be a problem to implement performant SSL in Java? It's not bindings to a C library, it's just a Java implementation.
I'll stop replying to this thread, cause I have no idea what I'm talking about, I just googled cause I was curious too; there are others that know more, if you're really curious post as a separate question here in /r/ruby and i bet someone will answer (or on stackoverflow; there's probably an answer there, actually there are probably already 20, 15-20 of which are outdated information, heh)
If you have to use windows then
Accept the fact that you are a second-class citizen in ruby-land and this is not going to change. There are some people that do amazing work making ruby on windows easier but the vast majority of ruby developers are of the opinion "If you want to cripple yourself by using windows then go ahead, but don't complain to us about it"
Use jruby, it is just easier.
Any idea how long that's going to take? Based on this it looks like they're just now finishing support for 1.9.3, but I don't keep up with JRuby so maybe I'm misunderstanding.