JavaScript has long been the dominant language for client-side web development. The size and complexity of client-side JavaScript programs continues to grow and now includes applications such as games, office suites, and image editing tools traditionally developed using high performance languages. More recently, developers have been expanding the use of JavaScript with standards and implementations for server-side JavaScript. These trends are driving a need for high performance JavaScript implementations. While the performance of JavaScript implementations is improving, support for creating parallel applications that can take advantage of now ubiquitous parallel hardware remains primitive. Pipeline, data, and task parallelism are ways of breaking a program into multiple units of work that can be executed concurrently by parallel hardware. These concepts are made explicit in the stream processing model of parallelization. Using the streaming model, an algorithm is divided into a set of small independent tasks called kernels that are linked together using first-in first-out data channels. The advantage of this approach is that it allows a compiler to effectively map computations to a variety of hardware while freeing programmers from the burden of synchronizing tasks or orchestrating communication between them. In this paper we describe Sluice, a library based method for the specification of streaming constructs in JavaScript applications. While the use of such a library makes concurrency explicit, it does not easily result in parallel execution. We show, however, that by taking advantage of the streaming model, we can dynamically re-compile Sluice programs to target a high performance, multi-threaded stream processing runtime layer. The stream processing layer executes computations in a different process and the offloaded tasks communicate with the original program using fast shared memory buffers. We show that this methodology can result in significant performance improvements for compute intensive workloads.
[1]
Jon Howell,et al.
Crom: Faster Web Browsing Using Speculative Execution
,
2010,
NSDI.
[2]
Scott A. Mahlke,et al.
Dynamic parallelization of JavaScript applications using an ultra-lightweight speculation mechanism
,
2011,
2011 IEEE 17th International Symposium on High Performance Computer Architecture.
[3]
Scott A. Mahlke,et al.
Dynamically accelerating client-side web applications through decoupled execution
,
2011,
International Symposium on Code Generation and Optimization (CGO 2011).
[4]
Edward A. Lee,et al.
Static Scheduling of Synchronous Data Flow Programs for Digital Signal Processing
,
1989,
IEEE Transactions on Computers.
[5]
Mason Chang,et al.
Trace-based just-in-time type specialization for dynamic languages
,
2009,
PLDI '09.
[6]
Michael I. Gordon,et al.
Exploiting coarse-grained task, data, and pipeline parallelism in stream programs
,
2006,
ASPLOS XII.