Web vs desktop applications的性能限制?

huangapple go评论83阅读模式
英文:

Performance limitations of web vs desktop applications?

问题

我们正在进行的项目是一个数据密集型实时应用程序。我们正在尝试决定是将前端设计为桌面应用程序(使用Java和JavaFX),还是Web应用程序(使用ReactJS)。将其设计为Web应用程序会有很多优势。但我们担心性能问题。我们无法承受将其制作成Web应用程序,只是后来发现在重负载下变得缓慢或出现延迟。前端将不得不处理复杂的用户界面和大型数据集(潜在地包含数百万条记录)。

有一件事特别让我们担忧,那就是我们找不到任何大规模实时Web应用程序的示例,它们能够处理我们的数据量。这让我们怀疑是否有可能做到这一点。

我的研究表明,桌面应用程序可以访问比在浏览器中运行的Web应用程序更多的资源,因此它们能够在性能上胜过它们。

英文:

The project we are working on is a data-intensive real-time application. We are trying to decide whether to make the front-end a desktop (in Java with JavaFX) or web app (in ReactJS). Making it a web app would have many advantages. But we are concerned about performance. We cannot afford to write it as a web app only to discover that it becomes slow or lags under heavy load afterwards. The front-end will have to handle a complex UI and large datasets (potentially with millions of entries).

One thing that particularly concerns us that we could not find any examples of large scale real-time web apps handling the amount of data ours will have to handle. That makes us wonder if it is possible at all.

My research suggests that desktop apps have access to more resources than web apps running in a browser and therefore are able to outperform them.

答案1

得分: 1

用户界面只应处理用户可以处理的数据量。您的用户能够每秒读取一百万条数据记录吗?可能不行。因此,请设计用户界面与后端之间的交互,以便界面只需处理用户能够消耗的数据。您可以应用惰性加载和分页等技术。

基于浏览器的应用程序可能仍然不如本地应用程序快,但对于大多数用途来说,它们已经足够快了。但您甚至没有将本地应用与浏览器应用进行比较,您是在将Java Swing与浏览器进行比较。在某些基准测试中,Chrome的"V8" JavaScript执行引擎超越了Java。目前还不清楚Java Swing用户界面是否比ReactJS用户界面更快还是更慢。

承诺一种技术,然后几个月后发现它行不通绝对不是理想的情况。我建议您开发一个快速的临时原型,以了解可能存在的问题所在。

英文:

The user interface should only handle as much data as the user can handle. Can your users read a million data records per second? Probably not. So design the interaction between the user interface and the backend so that the UI only has to process the data the user can consume. You would apply techniques like lazy-loading and paging.

Browser based applications might still not be as fast as native applications, but for most purposes they are "fast enough." But you're not even comparing native to browser, you're comparing Java Swing to browser. In some benchmarks, the Chrome "V8" JavaScript execution engine beats Java. It's not at all clear if a Java Swing UI would be faster or slower than a ReactJS UI.

It is certainly not ideal to commit to a technology and discover months later that it's not going to work out. I would recommend you develop a quick throw-away prototype to get an idea of where the pain points may lie.

huangapple
  • 本文由 发表于 2020年8月11日 10:39:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/63350711.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定