TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Emulator Performance: WebAssembly vs. JavaScript (2021)

37 点作者 jen_h超过 2 年前

5 条评论

RandomWorker超过 2 年前
&gt;UPDATE &gt; An earlier post described performance problems on Firefox and Safari, which were related to the Proxy object. This feature is used to read values from WebAssembly into JavaScript. &gt; After changing to Object.defineProperty() all browsers are equally fast on WebAssembly, beating JavaScript in all cases.<p>The update at the bottom is kind of interesting. All browsers are equally fast, which makes sense because wasm should speak directly to the hardware more easily than javascript.
评论 #33351619 未加载
flohofwoe超过 2 年前
A word about my C64 emulator: this is very CPU hungry, partly because the 6502 emulation uses a cycle-stepped model (<a href="https:&#x2F;&#x2F;floooh.github.io&#x2F;2019&#x2F;12&#x2F;13&#x2F;cycle-stepped-6502.html" rel="nofollow">https:&#x2F;&#x2F;floooh.github.io&#x2F;2019&#x2F;12&#x2F;13&#x2F;cycle-stepped-6502.html</a>), this causes the 6502 emulation to store and load context in each cycle which pretty much eliminates the opportunity that emulator state can be kept in registers across cycles, it also does an indirect jump for each cycle instead of just once per instruction. More importantly though, the VIC-II emulation isn&#x27;t very optimised, every cycle updates the entire chip state, sprite units and all (the VIC-II emulation dominates the per-frame budget much more than the CPU) - in general the implementation of the entire emulator is fairly straightforward, but also fairly brute-force.<p>When looking at emulator benchmarks it&#x27;s always important to also look at how the emulator has been implemented, and what compromises an emulator might make to balance between performance, accuracy and &quot;design purity&quot; (e.g. the cycle-stepping CPU model isn&#x27;t all that useful in practice, except that it is &#x27;more pure&#x27; and interesting from an emulator-design point-of-view). In comparison to those implementation differences, the performance difference between WASM and JS should be mostly negligible.
metadat超过 2 年前
Was the header image for this article generated via Stable Diffusion (or similar)?<p><a href="http:&#x2F;&#x2F;8bitworkshop.com&#x2F;docs&#x2F;_images&#x2F;js-vs-wasm-1.jpg" rel="nofollow">http:&#x2F;&#x2F;8bitworkshop.com&#x2F;docs&#x2F;_images&#x2F;js-vs-wasm-1.jpg</a><p>Inhumanly abstract, yet intriguing.
评论 #33351468 未加载
评论 #33350827 未加载
评论 #33350680 未加载
SevenNation超过 2 年前
&gt; I’ve been working on an experimental Verilog runtime that emits WebAssembly, generated from the AST nodes of the Verilog compiler.<p>No link in the article, and I wasn&#x27;t able to find a public project that tries to do this. Is there?
评论 #33350884 未加载
abdullah2993超过 2 年前
Where can one find the part that translate verilog to javascript? Is it open-source?