简体   繁体   English

Java是否在BeagleBone Black(或Raspberry Pi)中运行良好?

[英]Is Java running well in BeagleBone Black( or Raspberry Pi)?

My project is to run a web server in little computer such as BeagleBone Black or Raspberry Pi. 我的项目是在小型计算机(例如BeagleBone Black或Raspberry Pi)中运行Web服务器。

My question is which language is preferred, Java or C++? 我的问题是首选哪种语言,Java还是C ++? My plan is to run a tomcat and write a web server by using Java. 我的计划是使用Java运行tomcat并编写Web服务器。

I heard lot of people are talking about the poor performance of Java running in such embedded system such as BeagleBone Black. 我听说很多人都在谈论在像BeagleBone Black这样的嵌入式系统中运行Java的性能很差。 Does Java really have worse performance than running C++? Java的性能真的比运行C ++差吗?

Any thought is appreciated. 任何想法表示赞赏。 Thanks 谢谢

There is a java made for the ARM release (the architect BBB runs on). ARM发行版有一个Java语言(运行BBB的架构师)。 That java version is made by Oracle, and contains closed sourced libraries not available for the public. 该Java版本由Oracle制作,并且包含不公开的封闭源代码库。

The main complaints I have read about have been about OpenJDK java on the BBB due to that it's open source and doesn't have the ARM specific code and thus is a general one size fits all java solution which is about 4 or 5 times slower then the Oracle java. 我所读到的主要抱怨是关于BBB上的OpenJDK java的,因为它是开源的,并且没有ARM特定的代码,因此,一般来说,它适合所有java解决方案,其速度要慢4到5倍, Oracle Java。

In terms of C++, any java code will be slower then C++. 就C ++而言,任何Java代码都将比C ++慢。 This is due to that C++ code is complied for a specific board (this video helps to explain) and thus runs only on that specific board, while java even though have specific versions available for the JRE, the jar through the JDK is compiled to be non board specific and thus is not as fast as code that is already compiled for a specific board. 这是因为C ++代码是为特定板子编译的(此视频有助于解释) ,因此仅在该特定板子上运行,而Java尽管具有JRE的特定版本,但通过JDK的jar被编译为非板专用的,因此不如已经为特定板编译的代码快。

Lastly with all that said the preferred language depends on what you want to do and any official support provided by the manufacturer. 最后,所说的首选语言取决于您想要做什么以及制造商提供的任何官方支持。 The BBB seems to suggest none and leaves it up to the user. BBB似乎不建议任何建议,而是由用户决定。 Therefore the best idea is to run a benchmark test and see which performs best to your needs. 因此,最好的办法是进行基准测试,看看哪种测试最能满足您的需求。

Hope this helps! 希望这可以帮助!

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

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