简体   繁体   English

在 React 项目中使用 AssemblyScript 可以吗?

[英]is this ok to use AssemblyScript in React project?

I have a question about using AssemblyScript in React project I already read some stuff about using AssemblyScript to increase performance but the question is when my project is not that big sth like a game or machine learning etc when I have a less computational project, is that ok to use AssemblyScript to increase performance for better user experience?我有一个关于在 React 项目中使用 AssemblyScript 的问题我已经阅读了一些关于使用 AssemblyScript 来提高性能的东西但是问题是当我的项目不是那么大的时候像游戏或机器学习等当我有一个计算量较少的项目时,是吗可以使用 AssemblyScript 来提高性能以获得更好的用户体验吗? if yes could you please tell me where and when it's better to use it?如果是的话,你能告诉我在哪里和什么时候使用它更好吗?

There is a page on the official AssemblyScript website that goes into a few scenarios that you may encounter and if it would make sense to use AssemblyScript or Javascript, or both, for performance reasons.官方 AssemblyScript 网站上有一个页面介绍了您可能会遇到的一些情况,以及出于性能原因使用 AssemblyScript 或 Javascript 或两者是否有意义。

The main idea is, as you stated, that you benefit more from AssemblyScript if you have a compute-intensive application, a game or a webgl application, and for a blog or manipulating the DOM you can get away with using JavaScript.正如您所说,主要思想是,如果您有计算密集型应用程序、游戏或 webgl 应用程序,那么您可以从 AssemblyScript 中获益更多,对于博客或操作 DOM,您可以使用 JavaScript。

As always with performance problems, you have to benchmark the result in practice.与性能问题一样,您必须在实践中对结果进行基准测试。

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

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