布局引擎和javascript引擎之间的区别 [英] difference between layout engine and javascript engine

查看:69
本文介绍了布局引擎和javascript引擎之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

经过大量阅读之后,似乎当人们说浏览器引擎时,他们指的是诸如gecko或webkit之类的布局引擎。

After much reading, it seems that when people say, browser engine, they refer to the layout engine such as gecko or webkit.

我也知道布局引擎基本上负责绘画屏幕,而javascript引擎则用于解释。

I also know that the layout engine is basically responsible for "painting" the screen and the javascript engine is used for interpreting.

问题是针对现代Web应用程序的,它对性能?这两个有什么关系?它们在浏览器之外的其他用途是什么。它们还提供什么其他功能。

Question though, is for a modern web app, which has a bigger impact on performance? And how related are this two? What are their other uses outside the browser. What other functions do they serve.

非常感谢。

推荐答案

您的内容税最高的引擎将产生最大的影响。如果您有一个庞大的,复杂的HTML文档,其中包含成千上万个复杂节点,并且精心制作了CSS,那么您将在布局/渲染引擎上加倍费力,因此您可能会注意到各种浏览器之间的差异。但是,在大多数情况下,我认为您的内容必须相当复杂才能体现出明显的差异。

Whichever engine your content taxes the most will have the biggest impact. If you have a gigantic, complex HTML document with thousands of complex nodes and elaborate CSS, you will be taxing the layout/rendering engine a lot, and therefore you might notice differences between the various browsers. However, for the most part I believe your content has to be pretty darn complex for significant differences to manifest.

在javascript方面,如果您的页面高度动态且包含很多内容回调处理了许多快速事件并响应这些事件对文档进行了大的更改,因此javascript引擎将对您页面的性能产生更大的影响。

On the javascript side, if your page is highly dynamic with lots of callbacks processing many rapid events and making big changes to the document in response to those events, the javascript engine will have a larger impact on your page's performance.

浏览器,有时会在无头程序(例如PhantomJS)中使用布局/渲染引擎。 Javascript引擎可用于在非浏览器环境中解释javascript,就像使用node.js,Rhino等一样。

Outside of a browser, sometimes the layout/rendering engine will be used in a "headless" program such as PhantomJS. The Javascript engines can be used for interpreting javascript in non-browser environments as is done with node.js, Rhino, etc.

这篇关于布局引擎和javascript引擎之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆