npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

asm-dom-benchmarks

v0.0.1

Published

asm-dom benchmarks

Downloads

6

Readme

Benchmarks


Please read the entire file, there are some considerations that explain the results at the end of this page


In this directory you can find some code to measure the performance of asm-dom. In particular you can find the results of asm-dom and snabbdom, this allows you to make a comparison between the performance of asm-dom and a js virtual DOM. Before jumping to conclusions please read this list, this underline some important aspects:

  • asm-dom aims to let you write high perfomance SPA (Single page applications) in C++ that will be compiled into WebAssembly. This means that they will run until 4 times faster. However asm-dom needs to update the DOM and unfortunately, at the moment, this involves javascript. So, the internals of asm-dom will call js for you and they will deal with the overhead of the binding between JS and WASM. In the future, without these bindings, asm-dom will be even more powerful, however, you have to be aware that, for this reason, the results that you will see later won't represent the performance of your entire app, your code, your algorithms and so on will be a lot faster (they will be like the second test where there are no js calls). asm-dom will be the only place that will deal with the overhead of the js <-> wasm communication.

  • asm-dom does not leave garbage after the execution of its tests, while snabbdom might leave some garbage that need to be collected by the garbage collector.

There are 4 tests at the moment:

  • create nodes: this test create 700 nodes (100 nodes with 3 children, the last of which has 3 more children). Please note that, as we said before, in the case of asm-dom, this test creates but also destroys the nodes. While, in the case of snabbdom, the deletion is managed by the garbage collector and it is not measured.

  • diff equal nodes: this test runs the patch function 100 times with 2 equal nodes (2 nodes with 100 children, each of them has 1 child), so, the DOM will be not updated.

  • diff different nodes: this test runs the patch function 100 times with 2 nodes with different attributes (2 nodes with 100 children, each of them has 1 child), so, the DOM will be updated.

  • add/remove nodes: this test runs the patch function 100 times with 2 nodes, one with 100 children and one without children.

Here you can find the tests (lower is better) runned on a MacBook Pro (Retina, 13-inch, Late 2013), Processor 2,4 GHz Intel Core i5, Memory 8 GB 1600 MHz DDR3:

Firefox 59.0.2 (64 bit)

| library | create nodes | diff equal nodes | diff different nodes | add/remove nodes | | --- | --- | --- | --- | --- | | asm-dom | 0.0000 | 2.0000 | 34.0000 | 32.0000 | | snabbbom | 0.0000 | 12.0000 | 42.0000 | 44.0000 |

Chrome 66.0.3359.181 (64-bit)

| library | create nodes | diff equal nodes | diff different nodes | add/remove nodes | | --- | --- | --- | --- | --- | | asm-dom | 0.9000 | 3.2000 | 16.4000 | 15.1000 | | snabbbom | 0.5000 | 4.6000 | 8.7000 | 13.3000 |