简体   繁体   English

可以将Rails应用程序编译为独立应用程序运行吗?

[英]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. 关于Wt(用于构建网站的C ++框架)和Microsoft C#/。Net的好处之一是,重点是创建从二进制文件运行的完全编译的应用程序(包括内置的Web服务器)。 This can give a real performance and scaling boost. 这可以提供真正的性能和扩展能力。 I have seen Python compiled to machine code for HPC; 我已经看到Python被编译为HPC的机器代码。 is this possible for Rails apps? Rails应用程序有可能吗?

Not exactly. 不完全是。 The closest thing I know of would be to use jRuby to install your app as part of a Java application server. 我所知道的最接近的事情是使用jRuby将您的应用程序安装为Java应用程序服务器的一部分。

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. 正如@heyrolled所说,如果您使用jRuby,则可以执行此操作,从而将您的应用程序编译成一个由Tomcat加载和运行的JAR文件。

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. Ruby和Rails可以快速满足您的需求,在Ruby的执行速度受到质疑之前,您很可能会遇到数据库瓶颈。 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. 仅当您从数据库中索引了地狱,将工作集缓存在memcached或redis中,将不需要UI交互并且仍然遇到性能问题的所有内容推迟到后台时,才需要考虑语言执行速度。

Whew, that was a long-ass sentence. ew,那是长篇大话。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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