Skip to content

Commit

Permalink
Merge 8d5dacc into 58d43f5
Browse files Browse the repository at this point in the history
  • Loading branch information
mbasso committed Apr 24, 2018
2 parents 58d43f5 + 8d5dacc commit 28168ab
Show file tree
Hide file tree
Showing 76 changed files with 2,324 additions and 1,396 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ node_js:
- "8"
- "9"
install: true
sudo: required
services:
- docker
before_install:
- docker run -dit --name emscripten -v $(pwd):/src trzeci/emscripten:sdk-incoming-64bit bash
script:
- npm install --ignore-scripts
- docker exec -it emscripten npm run compile
- docker exec -it emscripten npm run compile:tests
- npm run lint
- npm run test:js
- npm run build
Expand All @@ -32,4 +39,5 @@ jobs:
branches:
only:
- master
if: tag =~ ^\d+\.\d+\.\d+
after_success: echo "Website online"
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ Also, here is the list of the online Demos:

## Roadmap

- [ ] create asm-dom boilerplate
- [ ] Thunks support
- [ ] asm-dom aims to be even more powerful with [GC/DOM Integration](http://webassembly.org/docs/future-features/). Unfortunately this is a future feature 🦄, so, we have to be patient and wait a bit.

Expand Down
6 changes: 3 additions & 3 deletions benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ 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.

- `create and 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 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.

- `create and 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.
- `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.

- `create and add/remove nodes`: this test runs the `patch` function 100 times with 2 nodes, one with 100 children and one without children.
- `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 screenshots of 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:

Expand Down
Binary file modified benchmarks/compiled/app.bc
Binary file not shown.
Binary file modified benchmarks/compiled/app.o
Binary file not shown.
138 changes: 69 additions & 69 deletions benchmarks/compiled/asmjs/app.asm.js

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions benchmarks/compiled/wasm/app.js

Large diffs are not rendered by default.

Binary file modified benchmarks/compiled/wasm/app.wasm
Binary file not shown.
4 changes: 2 additions & 2 deletions benchmarks/src/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int main() {
));
}
for (int i = 0; i < 10000; ++i) {
delete children[i];
deleteVNode(children[i]);
}

return 0;
Expand All @@ -61,7 +61,7 @@ void create() {
})
}
);
delete vnode;
deleteVNode(vnode);
}
};

Expand Down
22 changes: 10 additions & 12 deletions benchmarks/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ const config = {};
import('../compiled/wasm/app.wasm')
.then((wasm) => {
config.wasmBinary = new Uint8Array(wasm);
return new Promise((resolve) => {
import('../compiled/wasm/app.js').then(factory => {
const asmDom = factory(config);
delete asmDom.then;
resolve(asmDom);
});
return import('../compiled/wasm/app.js').then(factory => {
const asmDom = factory(config);
delete asmDom.then;
return asmDom;
});
})
.then((app) => {
Expand All @@ -48,19 +46,19 @@ import('../compiled/wasm/app.wasm')
message: 'create nodes',
fn: asmdomCpp.create,
}, {
message: 'create and diff equal nodes',
message: 'diff equal nodes',
setup: function () {
asmdomCpp.patchWithoutChangesSetup();
},
fn: asmdomCpp.patchWithoutChanges,
}, {
message: 'create and diff different nodes',
message: 'diff different nodes',
setup: function () {
asmdomCpp.patchWithChangesSetup();
},
fn: asmdomCpp.patchWithChanges,
}, {
message: 'create and add/remove nodes',
message: 'add/remove nodes',
setup: function () {
asmdomCpp.patchWithAdditionSetup();
},
Expand Down Expand Up @@ -89,7 +87,7 @@ import('../compiled/wasm/app.wasm')
}
},
}, {
message: 'create and diff equal nodes',
message: 'diff equal nodes',
setup: function() {
var elm = document.getElementById('root');
var children = [];
Expand Down Expand Up @@ -140,7 +138,7 @@ import('../compiled/wasm/app.wasm')
}
},
}, {
message: 'create and diff different nodes',
message: 'diff different nodes',
setup: function() {
const elm = document.getElementById('root');
var children = [];
Expand Down Expand Up @@ -191,7 +189,7 @@ import('../compiled/wasm/app.wasm')
}
},
}, {
message: 'create and add/remove nodes',
message: 'add/remove nodes',
setup: function() {
var elm = document.getElementById('root');
var children = [];
Expand Down
Binary file modified compiled/asm-dom.a
Binary file not shown.
Binary file modified compiled/asm-dom.bc
Binary file not shown.
Binary file modified compiled/asm-dom.o
Binary file not shown.
190 changes: 96 additions & 94 deletions compiled/asmjs/asm-dom.asm.js

Large diffs are not rendered by default.

Loading

0 comments on commit 28168ab

Please sign in to comment.