> For the complete documentation index, see [llms.txt](https://sliu583.gitbook.io/blog/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sliu583.gitbook.io/blog/specific-work/seminar-and-talk/reading-groups/network-reading-group/ml-and-networking/other/horcrux-automatic-javascript-parallelism-for-resource-efficient-web-computation.md).

# Horcrux: Automatic JavaScript Parallelism for Resource-Efficient Web Computation

* Modern web browsing&#x20;
  * Performance matters
    * User: 53% of visits are abandoned if a mobile site takes longer than 3s to load&#x20;
    * Content Providers: if your site makes $100,000/day, 1s improvement in page load increases revenue by $7,000 daily&#x20;
* The problem: computation delays&#x20;
  * Evaluation setup:&#x20;
    * Performance metrics: Page Load Time (PLT), Speed Index (SI)&#x20;
  * Developed Region, Emerging Region&#x20;
* Why are computation delays significant&#x20;
  * 80% more JavaScript over the last 5 years&#x20;
  * Mobile Devices
    * **More cores != better performance**&#x20;
    * Reason: Single-thread execution --> solution: parallelizing JavaScript&#x20;
    * Main idea: **automatically parallelizes JavaScript execution using concolic execution to take advantage of phones multi-core CPUs**&#x20;
* &#x20;Parallelism Opportunities&#x20;
  * Web workers are widely supported by browsers&#x20;
  * Constrained APIs:
    * No access to DOM APIs&#x20;
    * No access to the main global state&#x20;
  * Legacy pages are highly amenable to safe parallelism&#x20;
* Challenges&#x20;
  * C1: ensuring correctness&#x20;
    * The exact state accessed by parallelized JavaScript --> conservative signatures&#x20;
      * Despite non-determinism and across all possible control paths&#x20;
    * Conservative signatures&#x20;
      * Dynamic analysis: track read / writes to page state&#x20;
      * Concolic execution: explore all possible control paths&#x20;
      * ![](/files/qu8gS4XUgNSCPdhoMuSo)
      * Server-side and offline&#x20;
  * C2: web workers constrained APIs
    * How to parallelize execution with constrained APIs?&#x20;
      * Client-side parallelization scheduler&#x20;
        * Runs in the main browser thread
        * Only task: manage offloads in event-driven mode&#x20;
  * C3: Offloading overheads&#x20;
    * Pass-by-value I/O can take \~0-10ms&#x20;
      * Root-function Granularity&#x20;
      * Offloading Granularity&#x20;
        * Trade-off: parallelization benefits vs. offloading overheads&#x20;
        * Solution: offloading root-function invocations&#x20;
        * 4x fewer offloads and 73% of parallelization benefits&#x20;
* Evaluation&#x20;
  * Impact on browser computation delays?&#x20;
    * Total computation time (TCT)
  * Impact on end-to-end performance?
    * Page Load Time (PLT), Speed Index (SI)&#x20;
  * Horcrux comparison to prior compute optimizations?
  * What do conservative signatures forgo?
  * How much are the server-side overheads?&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sliu583.gitbook.io/blog/specific-work/seminar-and-talk/reading-groups/network-reading-group/ml-and-networking/other/horcrux-automatic-javascript-parallelism-for-resource-efficient-web-computation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
