DOI QR코드

DOI QR Code

The Priority Heuristics for Concurrent Parsing of JavaScript

자바스크립트 동시 파싱을 위한 우선순위 휴리스틱

  • 차명수 (서울대학교 전기정보공학부) ;
  • 박혁우 (서울대학교 전기정보공학부) ;
  • 문수묵 (서울대학교 전기정보공학부)
  • Received : 2017.03.30
  • Accepted : 2017.05.26
  • Published : 2017.08.15

Abstract

It is important to speed up the loading time of web applications. Parsing is a loading process that contributes to an increased loading time. To address this issue, the optimization called Concurrent Parsing has been proposed which handles the parsing process in parallel by using additional threads. However, Concurrent Parsing has a limitation that it does not consider the priority order of parsing. In this paper, we propose heuristics that exploit priorities of parsing to improve the Concurrent Parsing. For parsing priority, we empirically investigate the sequence of function calls, classify functions into 3 categories, and extract function call probabilities. If a function has high call probability, we give a high priority and if a function has low probability, we give a low priority. We evaluate this priority heuristics on real web applications and get the 2.6% decrease of loading time on average.

웹 어플리케이션은 로딩 시간을 빠르게 하는 것이 중요하다. 파싱은 로딩 과정 중 하나로서 로딩을 길어지게 하는 원인이 되고 있다. 이러한 이유로 파싱 쓰레드를 만들어 파싱을 병렬화 시킨 동시 파싱 기법이 제안되었다[3]. 그러나 동시 파싱은 파싱 순서에 대한 고려가 없다는 한계가 있었다. 본 논문에서는 동시 파싱을 사용할 때 어떤 함수를 먼저 파싱해야 하는가에 대한 휴리스틱을 제안한다. 파싱 우선 순위를 정하기 위해 실제 웹 어플리케이션의 자바스크립트 함수들을 분석하여 함수를 세 가지 기준으로 분류하였고, 각 분류의 호출 확률(call probability)을 구하였다. 조사한 호출 확률을 이용하여 높은 호출 확률을 갖는 함수들에 높은 파싱 우선 순위를 주었고, 반대로 낮은 호출 확률의 함수들은 낮은 우선 순위를 주었다. 정의한 우선 순위를 토대로 휴리스틱을 제안했고 이를 검증하기 위해 실제 웹 어플리케이션에서 로딩 시간을 측정하여 최대 3.8%, 평균 2.6%의 로딩 시간을 단축하였다.

Keywords

Acknowledgement

Supported by : 한국연구재단

References

  1. S.-W. Lee, and S.-M. Moon, "Selective Just-in-Time Compilation for Client-side Mobile JavaScript Engine," International Conference on Compilers, Architectures and Synthesis of Embedded Systems, ACM, pp. 5-14, 2011.
  2. J. Oh, and S. -M. Moon, "Snapshot-based Loading-Time Acceleration for Web Applications," Proc. Of the 13th Annual IEEE/ACM International Symposium on Code Generation and Optimization, IEEE, pp. 179-189, 2015.
  3. H. Park, M. Cha, and S. -M. Moon, "Concurrent JavaScript parsing for faster loading of Web apps," ACM Transactions on Architecture and Code Optimization, Vol. 13, Issue 4, No. 41, 2016.
  4. Filip Pizlo, (2014, May 13), ". Available : https://webkit.org/blog/3362/introducing-the-webkit-ftl-jit (downloaded 2017, Jan. 7)
  5. Yang Guo, (2014, Feb. 13), "Compiling in the background for a smoother user experience," [Online]. Available : https://blog.chromium.org/2014/02/compiling-in-background-for-smoother.html (downloaded 2017, Jan. 7)
  6. The jQuery Foundation, "jQuery," [Online]. Available : https://jquery.com (downloaded 2017, Jan. 7)
  7. Hardkernel Co., "ODROID-C1+ quad core singleboard computer," [Online]. Available : http://www.hardkernel.com (downloaded 2017, Jan. 7)
  8. Apple Inc., "WebKit," [Online]. Available : https://webkit.org (downloaded 2017, Jan. 7)
  9. Z. Zhao, M. Bebenita, D. Herman, J. Sun, and X. Shen, "HPar: A practical parallel parser for HTML--taming HTML complexities for parallel parsing," ACM Transactions on Architecture and Code Optimization, Vol. 10, Issue 4, No. 44, pp. 195-226, 2013.
  10. addyosmani, (2016, Dec. 14) "V8 Optimisations to enable fast pagestartup," [Online]. Available : https://gist.github.com/addyosmani/671b56d3f69ac4b88f45 (downloaded 2017, Jan. 7)