针对嵌入式浏览器 CSS(Cascading Style Sheets)解析效率低下的问题,提出一种 CSS 引擎并行化处理方法。通过对 CSS引擎资源预取、样式解析和选择器匹配功能的描述,分别介绍如何将资源预取、样式解析与网页解析并行执行,以及 CSS 选择器并行匹配。该并行处理方法可以克服嵌入式浏览器边解析边加载带来的网络延时以及串行处理带来的用户等待时间长的问题。通过对多种网页加载时间的仿真测试,页面的加载速度提高了很多,实验结果验证了该方法的可行性。%To solve the low efficiency problem of CSS parsing in embedded browsers,this paper proposes a CSS engine parallelised processing method.Through the resources prefetching on CSS engine,the style parsing and description of the selector matching function,we respectively introduce how to parallelise the execution of resources prefetching,style parsing and webpage parsing,as well as the parallel matching of CSS selectors.This parallel processing method can overcome the network delay incurred by the embedded browsers loading the resources while parsing,and the long time waiting problem brought forth by serialise processing.By a variety of webpages load time simulation tests,the loading speed of webpages raised a lot.Experimental result verifies the feasibility of the proposed method.
展开▼