Why HTML/Web UI response slower than Native UI?

前端 未结 5 1345
天涯浪人
天涯浪人 2021-02-05 10:37

I can\'t understand, Why HTML/Web UI response slower than WinForms/WPF/Android View/Native UI?

The Native UI also have styles, elements nesting, events than the CSS, DOM

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-05 11:00

    The time spent on the client is negligible compared to the time the data spends travelling over the network. The actual render time of a Windows form or a webpage in a browser is measured in (tens or maybe hundreds) of microseconds. Sending a request to a server and getting the result back is measured in milliseconds.

    You can confirm this quite easily:

    1. Create a simple Winforms application, time it.
    2. Create a similar Web-based application. Run it on the webserver on your own PC, I.E. //localhost/myapp.asp and time it.
    3. Run it on a remote webserver and time it.

    You'll see that 1 is fastest followed closely by 2 (a little slower, interpreting the HTML, the CSS etc) and 3 is vastly slower because of the network time.

    To answer your question, the difference due almost entirely to network delays, which are an order of magnitude greater than local processing time.

    EDIT: It would be kind of the downvoters to add a comment explaining why.

提交回复
热议问题