文摘
Finite State Machine (FSM) is widely applied to parsing the html pages in WebKit browser. In the traditional WebKit kernel, single thread is used to parse web pages, therefore cannot make full use of multi-core processors and page analysis in kernel is not granular down to html paragraphs, resulting in the browser working serially in each page. Our research is about realizing the page parallel parsing in WebKit, aiming at improving the browser’s parsing speed. Made some optimizations on the method proposed in [13], we put forward a novel parsing model named PFBE (Parallel FSM Browser Engine) from the aspect of data parallelism, realizing the preliminary parser to load network resources and parsing string in parallel, thus using multi-core processors to improve browser’s performance. PFBE carved up the input data into multiple segmentation which contained public characters for processing, through comparing the public characters to determine whether to merge the segmentation. PFBE utilized original serial FSM which has highly optimized, compatible with HTML5 standards and technology. We used Chromium web engine to present PFBE in detail and the result proved the improvement of PFBE comparing with serial FSM, and the page loading time has been reduced by 12.36%.