Hi,I wonder what arguments do you have against JRuby and what experience have you had with it?
My biggest concerns at this moment are:
- Warmup-time (just too slow for any kind of TDD);
- Stacktraces (yes, it's worth mentioning! :) )
- Gems compatibility;
The reason for this question is basically neo4j database. I can't see all its benefits with REST API.This leaves me with native Java bindings (and this brings me to JRuby).
As for startup I wonder if nailgun would be of help
http://railstech.com/2010/08/how-to-improve-performance-of-java-using-nailgun-server/
Hopefully I'll get a chance to play with them one day.
> My biggest concerns at this moment are:
> Warmup-time (just too slow for any kind of TDD);
JRuby isn't designed for TDD or to run in development. It's intended to be an industrial grade ruby for production.
(For what it's worth, I think the startup time of a rails stack on C ruby (charitably, 5 seconds) is still far too slow to effectively test-drive anything.)
- Ben
On 07/12/2011, at 12:54 PM, Dmytrii Nagirniak wrote:My biggest concerns at this moment are:Warmup-time (just too slow for any kind of TDD);
JRuby isn't designed for TDD or to run in development. It's intended to be an industrial grade ruby for production.
(For what it's worth, I think the startup time of a rails stack on C ruby (charitably, 5 seconds) is still far too slow to effectively test-drive anything.)
> Torquebox http://torquebox.org/ looks like a pretty nice project and
> they just put out the 2.0 beta.
JBoss thing scared me away enough :)
But thank. I'll keep it in mind.
> As for startup I wonder if nailgun would be of help
> http://railstech.com/2010/08/how-to-improve-performance-of-java-using-nailgun-server/
Yeah. It may help but not sure whether it's worth the hassle. It improves the JVM startup time a bit, but the warmup time is still too slow.
On Wed, Dec 7, 2011 at 12:54 PM, Dmytrii Nagirniak <dna...@gmail.com> wrote:Short version: it will give you pain, but it's sometimes worth it.
Used JRuby at my last job. There are workarounds for the warmup time on tests, but we never _quite_ got them working.
We also found that our hour-long cuke run would get in to some weird GC fail-loop where it would OOM no matter how much memory you gave the JVM.Also also we had weirdness with the JDBC wrapper & ActiveRecord & background tasks.
We had the problem where when investigating errors we always had to wonder "is this a common problem, or is this a JRuby incompatibility?"
There are good reasons to use JRuby over MRI (performance & Java integration). There are too many downsides to make it my 'default' stack.
We also found that our hour-long cuke run would get in to some weird GC fail-loop where it would OOM no matter how much memory you gave the JVM.Also also we had weirdness with the JDBC wrapper & ActiveRecord & background tasks.
Can you give some more details on this if you still remember those? Just to be aware of.
Do you think it could have changed since then?
Not good enough in terms of features?
I guess it's more Java, but extending the API may be an option.
Cheers,
Chris
Yes, features.
There are couple of gems that help with it: neology (not maintained, failing specs), architect4j (ActiveRecord-like, new project, some failing specs).
I even thought to come up with something better. But then I realised it's not that simple.
Those abstractions are leaky and the best bet is to stay as close to the HTTP request/response as you can.
While, with native bindings, you can traverse the graph natively from ruby. And it's is pretty efficient.
With REST you'd have to run traversal queries for that.
It basically means that anything more or less complicated involves a number of HTTP req/resp and wrapping all that with your models.
I wonder what arguments do you have against JRuby and what experience have you had with it?
> We seldom used JRuby in development environments, though, mainly because of the VM startup time. This led to a situation where development and most of the automated testing ran on a slightly different stacks. Most of the time that worked out okay, but when there were compatibility problems, they were a real pig to track down and fix. To be fair, many of these problems were caused by differing RDBMS engines (MS-SQL vs SQLite), rather than anything specific to JRuby.
Every time I hear something like this (different environments) I remember a DBA I used to work with.
He said that you should always run the same environment everywhere.
And I agree with him more and more.
That's fine to use different DBs for very simple, basic stuff.
But the minute you want to write SQL, it's better to stick with the target DB.
Anyway, thanks for sharing this. Much appreciated!
> The situation reached breaking point when we started doing a lot of work with XML and HTML, and became heavily dependent on Nokogiri, which produced a constant stream of issues on JRuby. In the end, LP yanked out MS-SQL in favour of PostgreSQL, and reverted to MRI.
So again gems compatibility...
Hmm. Do you know how much it has changed since?
> In retrospect, I wish I'd pushed harder, and earlier, to use a different (and non-proprietary) database, and stuck with MRI.
Good point. Would you consider neo4j proprietary though?
> As Michael P said, once you wander off the conventional path (Rails on MRI, with MySQL or PostgreSQL behind) you're more likely to hit issues that other people haven't ... or at least issues that other people haven't already solved. Having said that, you're halfway there already, by choosing to use Neo4J, so why not go all out? :-)
That's true. I'm definitely going to have some issues there.
One thing that keeps me warm is that neo4j community seems to be pretty active.
And neo4j devs respond amazingly quickly. So fingers crossed :)
> Every time I hear something like this (different environments) I remember a DBA I used to work with. He said that you should always run the same environment everywhere.
Indeed. On the other hand, I think the benefits we got from using a lighter-weight stack for development outweighed the disadvantages.
>> The situation reached breaking point when we started doing a lot of work with XML and HTML, and became heavily dependent on Nokogiri, which produced a constant stream of issues on JRuby. In the end, LP yanked out MS-SQL in favour of PostgreSQL, and reverted to MRI.
>
> So again gems compatibility...
> Hmm. Do you know how much it has changed since?
I think it depends entirely on the gems you're using. Anything pure-Ruby is unlikely to cause issues - it's the stuff that requires native bindings that killed us. In some cases, the gem we wanted simply wasn't available for JRuby. This may have improved since, with the work the JRuby guys did last year to support MRI's C-extension API.
In the case of Nokogiri, using it with JRuby required use of FFI, which caused installation problems; sorry, I can't recall the details. The Nokogiri crowd have now dumped the FFI bindings, and implemented a "pure Java" backend. I played with the early releases of that work, and hit too many problems. I'm sure things have improved, but given that it sits on a completely different foundation (Xerces, Xalan, etc, rather than libxml) I very much doubt that it's 100% compatible across platforms.
>> In retrospect, I wish I'd pushed harder, and earlier, to use a different (and non-proprietary) database, and stuck with MRI.
> Good point. Would you consider neo4j proprietary though?
Not at all. If you can easily run it (for free) in your development environment, then that's good enough for me.
--
cheers,
Mike Williams
On 07/12/2011, at 6:01 PM, Dmytrii Nagirniak wrote:Every time I hear something like this (different environments) I remember a DBA I used to work with. He said that you should always run the same environment everywhere.
Indeed. On the other hand, I think the benefits we got from using a lighter-weight stack for development outweighed the disadvantages.
The situation reached breaking point when we started doing a lot of work with XML and HTML, and became heavily dependent on Nokogiri, which produced a constant stream of issues on JRuby. In the end, LP yanked out MS-SQL in favour of PostgreSQL, and reverted to MRI.So again gems compatibility...Hmm. Do you know how much it has changed since?
I think it depends entirely on the gems you're using. Anything pure-Ruby is unlikely to cause issues - it's the stuff that requires native bindings that killed us. In some cases, the gem we wanted simply wasn't available for JRuby. This may have improved since, with the work the JRuby guys did last year to support MRI's C-extension API.
Each time I try to get MRI 1.9 compatible code running on JRuby I hit
issues that discourage me enough to give up for another few months.
I tried last week and hit two issues [1] and [2]. I tried a few months
ago and hit [3]. It feels like their 1.9 support is still not
production ready.
You're right to mention stacktraces as an issue too. When things go
wrong you often get a 400 line java stack trace with no relevance to
your ruby code. It's traumatising.
All that said, @headius is super responsive so hopefully things will
continue to improve.
James
[1] https://twitter.com/#!/jim_healy/status/143248520256831490
[2] http://jira.codehaus.org/browse/JRUBY-6170.
[3] http://jira.codehaus.org/browse/JRUBY-5967
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby or Rails Oceania" group.
> To post to this group, send email to rails-...@googlegroups.com.
> To unsubscribe from this group, send email to
> rails-oceani...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rails-oceania?hl=en.
On 07/12/2011, at 9:13 PM, Mike Williams wrote:On 07/12/2011, at 6:01 PM, Dmytrii Nagirniak wrote:Every time I hear something like this (different environments) I remember a DBA I used to work with. He said that you should always run the same environment everywhere.
Indeed. On the other hand, I think the benefits we got from using a lighter-weight stack for development outweighed the disadvantages.
I definitely feel the benefits of lightweight dev stack (I myself use sqlite during dev).But I when you need to do a little bit more complex things (geospatial, DB-driven full-text search etc) then it just doesn't work well.You either have to effectively maintain both dev and prod environments.But I agree that something as RDBMS can be relatively easy abstracted away.
I occassionally run my work project on other implementations of Ruby
for the fun of it. Hopefully it'll lead to the alternative
implementations being better, and maybe the bug reports will help
improve RubySpec.
About half of my bug reports for Rubinius are the result of running my
work project against it, and the other half are from the Small Eigen
Collider. https://github.com/rubinius/rubinius/issues/created_by/agrimm?sort=created&direction=desc&state=closed&page=1
https://github.com/agrimm/small_eigen_collider/wiki/Bugs-found
If finding and reporting bugs is easy, and workarounds are
time-consuming and waiting for bug fixes takes a while, then it may
make sense to run tests on Ruby implementations you aren't currently
using.
Andrew
About half of my bug reports for Rubinius are the result of running my
work project against it, and the other half are from the Small Eigen
Collider. https://github.com/rubinius/rubinius/issues/created_by/agrimm?sort=created&direction=desc&state=closed&page=1
https://github.com/agrimm/small_eigen_collider/wiki/Bugs-found
Sorry this thread is kind of old but I wanted to weigh in, hope it's not
too late to be relevant.
We started embedding neo4j inside JRuby but quickly switched to the
stand-a-lone server. Massive stability and corruption issues with the
embedded one the moment we sent even a trifling production load at it.
This was on 1.4 and 1.5rc1, so perhaps things are a little better now.
Embedded is useful for once off batch loads to get you started though.
Protip for this: use the java classes directly, don't try to use the
neo4j ruby gem abstraction (use it to give you access to the java
classes though: require it, just don't use any of its ruby classes.)
This way you can copy all the examples from the manual and not have to
worry about Weird Stuff.
If you have complicated traversals and gremlin doesn't work for you,
write a java plugin. (Sorry.)
Neology works fine for us even though it's a little cruft. It's a
trivial wrapper on top of HTTP so not much to go wrong.
In general, develop on MRI, deploy to JRuby, run CI over both and you
won't go too far wrong after some initial teething problems. I gave a
talk at the JRuby meetup here last week, it was recorded so hopefully
will be published soon.
Xav
Sorry this thread is kind of old but I wanted to weigh in, hope it's not too late to be relevant.
We started embedding neo4j inside JRuby but quickly switched to the stand-a-lone server. Massive stability and corruption issues with the embedded one the moment we sent even a trifling production load at it. This was on 1.4 and 1.5rc1, so perhaps things are a little better now.
Embedded is useful for once off batch loads to get you started though. Protip for this: use the java classes directly, don't try to use the neo4j ruby gem abstraction (use it to give you access to the java classes though: require it, just don't use any of its ruby classes.) This way you can copy all the examples from the manual and not have to worry about Weird Stuff.
Neology works fine for us even though it's a little cruft. It's a trivial wrapper on top of HTTP so not much to go wrong.
In general, develop on MRI, deploy to JRuby, run CI over both and you won't go too far wrong after some initial teething problems. I gave a talk at the JRuby meetup here last week, it was recorded so hopefully will be published soon.
On 23/01/12 12:10 AM, Dmytrii Nagirniak wrote:
>> Neology works fine for us even though it's a little cruft. It's a
>> trivial wrapper on top of HTTP so not much to go wrong.
>
> I wonder how do you wrap the models/services/logic with it.
> It's a bit infortunate to lose all the goodness of Rails with
> ActiveRecord/DataMapper.
> Neo4j.rb does the job there.
Yeah, we're not doing any of that sort of stuff. Pretty simple ETL typle
stuff.