I accidentally saw a colleague asking this question last night. I paid attention and thought about it, and also referred to some comments on the Internet, but I didn't find anything I wanted. I feel that all mobile terminals should use webview. Why is there a big gap sometimes?
Does the poster mean to compare the Native app with the app made by H5? If so:
The first problem with H5 is animation. No matter you use Css3 animation or js animation, it is not as smooth as the native one. In some cases, it may not be as smooth as the original one. It's not obvious, but when used in large quantities, page rendering and remote data reading will cause lags, and even preloading is not ideal.
The second one is when loading large-scale data to render pages, frequent DOM operations, even if the MVVM framework is used, the lower-level page resources are cached in advance. You must also ensure that your code is elegant and good enough, and memory control is required. Very good, this is also a test for the programmers themselves. The compatibility of WebView is also tight.
The most important thing is that no matter what solution and method you use, performance issues are incomparable to Native apps.
The APP is implemented in native language, so the efficiency and speed are definitely better; for web pages, it either relies on the network, or renders the web page through intermediate conversion, which requires more processes than native language, so web pages are bound to be better than native ones. The APP is slower; but the gap will become smaller and smaller. I believe that one day the web page will be as smooth.
Aren’t most resources on the mobile side local?
Just get some text through the api
The architecture of mobile applications is still mainly native, and there are relatively few places where webview is used, such as rich text, event pages, etc.
Take iOS as an example. The UI interface will be loaded first, and then the requested data will be loaded. However, the mobile web page requires the server to return a large amount of data such as html, css, js and other libraries before the interface can be displayed. Therefore, the mobile web page gives people The feeling is stuck.
I also discovered this problem. Perhaps the essence is that DOM operations are more time-consuming than the various hide and show functions of the native app. Because the earliest HTML design was for simple page display and streaming content. Nowadays, there are more and more page elements, especially the overlapping of various elements. Repeated additions, deletions and modifications of the DOM cause lags. For example, when opening large files with vscode and sublime, no matter how high-configuration the computer is, there will always be some lag when using the former, although it is only about 1-2 seconds. Sublime is a native application, so it is not so stuck.