Doehyun Baek, Jakob Getz, Yusung Sim, Daniel Lehmann, Ben L. Titzer, Sukyoung Ryu, Michael Pradel
{"title":"Wasm-R3:针对真实和独立 WebAssembly 基准的记录-缩减-重放功能","authors":"Doehyun Baek, Jakob Getz, Yusung Sim, Daniel Lehmann, Ben L. Titzer, Sukyoung Ryu, Michael Pradel","doi":"arxiv-2409.00708","DOIUrl":null,"url":null,"abstract":"WebAssembly (Wasm for short) brings a new, powerful capability to the web as\nwell as Edge, IoT, and embedded systems. Wasm is a portable, compact binary\ncode format with high performance and robust sandboxing properties. As Wasm\napplications grow in size and importance, the complex performance\ncharacteristics of diverse Wasm engines demand robust, representative\nbenchmarks for proper tuning. Stopgap benchmark suites, such as PolyBenchC and\nlibsodium, continue to be used in the literature, though they are known to be\nunrepresentative. Porting of more complex suites remains difficult because Wasm\nlacks many system APIs and extracting real-world Wasm benchmarks from the web\nis difficult due to complex host interactions. To address this challenge, we\nintroduce Wasm-R3, the first record and replay technique for Wasm. Wasm-R3\ntransparently injects instrumentation into Wasm modules to record an execution\ntrace from inside the module, then reduces the execution trace via several\noptimizations, and finally produces a replay module that is executable\nsandalone without any host environment - on any engine. The benchmarks created\nby our approach are (i) realistic, because the approach records real-world web\napplications, (ii) faithful to the original execution, because the replay\nbenchmark includes the unmodified original code, only adding emulation of host\ninteractions, and (iii) standalone, because the replay benchmarks run on any\nengine. Applying Wasm-R3 to web-based Wasm applications in the wild\ndemonstrates the correctness of our approach as well as the effectiveness of\nour optimizations, which reduce the recorded traces by 99.53 percent and the\nsize of the replay benchmark by 9.98 percent. We release the resulting\nbenchmark suite of 27 applications, called Wasm-R3-Bench, to the community, to\ninspire a new generation of realistic and standalone Wasm benchmarks.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2024-09-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Wasm-R3: Record-Reduce-Replay for Realistic and Standalone WebAssembly Benchmarks\",\"authors\":\"Doehyun Baek, Jakob Getz, Yusung Sim, Daniel Lehmann, Ben L. Titzer, Sukyoung Ryu, Michael Pradel\",\"doi\":\"arxiv-2409.00708\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"WebAssembly (Wasm for short) brings a new, powerful capability to the web as\\nwell as Edge, IoT, and embedded systems. Wasm is a portable, compact binary\\ncode format with high performance and robust sandboxing properties. As Wasm\\napplications grow in size and importance, the complex performance\\ncharacteristics of diverse Wasm engines demand robust, representative\\nbenchmarks for proper tuning. Stopgap benchmark suites, such as PolyBenchC and\\nlibsodium, continue to be used in the literature, though they are known to be\\nunrepresentative. Porting of more complex suites remains difficult because Wasm\\nlacks many system APIs and extracting real-world Wasm benchmarks from the web\\nis difficult due to complex host interactions. To address this challenge, we\\nintroduce Wasm-R3, the first record and replay technique for Wasm. Wasm-R3\\ntransparently injects instrumentation into Wasm modules to record an execution\\ntrace from inside the module, then reduces the execution trace via several\\noptimizations, and finally produces a replay module that is executable\\nsandalone without any host environment - on any engine. The benchmarks created\\nby our approach are (i) realistic, because the approach records real-world web\\napplications, (ii) faithful to the original execution, because the replay\\nbenchmark includes the unmodified original code, only adding emulation of host\\ninteractions, and (iii) standalone, because the replay benchmarks run on any\\nengine. Applying Wasm-R3 to web-based Wasm applications in the wild\\ndemonstrates the correctness of our approach as well as the effectiveness of\\nour optimizations, which reduce the recorded traces by 99.53 percent and the\\nsize of the replay benchmark by 9.98 percent. We release the resulting\\nbenchmark suite of 27 applications, called Wasm-R3-Bench, to the community, to\\ninspire a new generation of realistic and standalone Wasm benchmarks.\",\"PeriodicalId\":501197,\"journal\":{\"name\":\"arXiv - CS - Programming Languages\",\"volume\":null,\"pages\":null},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2024-09-01\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"arXiv - CS - Programming Languages\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/arxiv-2409.00708\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Programming Languages","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2409.00708","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
Wasm-R3: Record-Reduce-Replay for Realistic and Standalone WebAssembly Benchmarks
WebAssembly (Wasm for short) brings a new, powerful capability to the web as
well as Edge, IoT, and embedded systems. Wasm is a portable, compact binary
code format with high performance and robust sandboxing properties. As Wasm
applications grow in size and importance, the complex performance
characteristics of diverse Wasm engines demand robust, representative
benchmarks for proper tuning. Stopgap benchmark suites, such as PolyBenchC and
libsodium, continue to be used in the literature, though they are known to be
unrepresentative. Porting of more complex suites remains difficult because Wasm
lacks many system APIs and extracting real-world Wasm benchmarks from the web
is difficult due to complex host interactions. To address this challenge, we
introduce Wasm-R3, the first record and replay technique for Wasm. Wasm-R3
transparently injects instrumentation into Wasm modules to record an execution
trace from inside the module, then reduces the execution trace via several
optimizations, and finally produces a replay module that is executable
sandalone without any host environment - on any engine. The benchmarks created
by our approach are (i) realistic, because the approach records real-world web
applications, (ii) faithful to the original execution, because the replay
benchmark includes the unmodified original code, only adding emulation of host
interactions, and (iii) standalone, because the replay benchmarks run on any
engine. Applying Wasm-R3 to web-based Wasm applications in the wild
demonstrates the correctness of our approach as well as the effectiveness of
our optimizations, which reduce the recorded traces by 99.53 percent and the
size of the replay benchmark by 9.98 percent. We release the resulting
benchmark suite of 27 applications, called Wasm-R3-Bench, to the community, to
inspire a new generation of realistic and standalone Wasm benchmarks.