简体   繁体   中英

Can a rails app be compiled to run as standalone applications?

One of the nice things about Wt, the C++ framework for build websites, and Microsoft C#/.Net, is that the focus is on creating fully compiled applications (including built in web server) that run from binaries. This can give a real performance and scaling boost. I have seen Python compiled to machine code for HPC; is this possible for Rails apps?

Not exactly. The closest thing I know of would be to use jRuby to install your app as part of a Java application server.

As @heyrolled said, you can do it if you use jRuby, whereby your app is compiled into a JAR file that is loaded and ran by Tomcat.

However, I'd like to posit that this is premature optimization. Ruby and Rails are plenty fast for what you'd need and you'll more likely be experiencing bottlenecks on the database before the speed of execution by Ruby comes into question. Only when you have indexed the hell out of your database, cached the working set in memcached or redis, deferred to the background all the things that don't need UI interaction and are still running into performance problems do you need to consider language execution speed.

Whew, that was a long-ass sentence.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM