Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmarks + $mol + CycleJS + Svelte + Flavour #2134

Open
wants to merge 62 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
de2db13
Added $mol implementation.
nin--jin Dec 15, 2016
c12d800
Added benchmarking.
nin--jin Dec 15, 2016
771dba9
Removed testing code.
nin--jin Dec 15, 2016
53306ae
Merge branch 'examples/mol'
nin--jin Dec 15, 2016
1afc99d
Added / to end of page url, because github redirects to http protocol…
nin--jin Dec 15, 2016
d5b8280
Merge branch 'benchmark'
nin--jin Dec 15, 2016
f7955fe
Added base files.
nin--jin Dec 15, 2016
0284f9e
Merge branch 'examples/mol'
nin--jin Dec 15, 2016
b8ed262
Added cyclejs
nin--jin Jan 26, 2017
3056b78
Drop cyclejs submodule.
nin--jin Jan 26, 2017
662e460
Added cyclejs example.
nin--jin Jan 26, 2017
f142e02
New mol version.
nin--jin Feb 1, 2017
56231ad
New $mol example.
nin--jin Mar 30, 2017
dfef3fa
Better measuring in benchmark.
nin--jin Mar 30, 2017
feb8ea6
Merge branch 'master' of https://github.com/tastejs/todomvc
nin--jin Jul 17, 2017
6d9bea8
New build of $mol example.
nin--jin Jul 17, 2017
f463076
Added Angular2 es2015 to learn.json
nin--jin Jul 17, 2017
2ea9c06
Added Angular4 example.
nin--jin Jul 17, 2017
3c16941
Fixed paths in Angular 4
nin--jin Jul 17, 2017
c4e065d
Fixed todomvc link.
nin--jin Jul 21, 2017
bf1bce0
prop build of angulag 4
nin--jin Aug 6, 2017
c7256c0
No "Example" word in bench menu.
nin--jin Aug 6, 2017
375a03a
Angular4 remove because implementation does not support: routing, loc…
nin--jin Aug 7, 2017
590a5f8
Fixed mol example.
nin--jin Aug 7, 2017
e0b145a
Params for benchmark.
nin--jin Aug 7, 2017
faa3d0b
Clear local storage before tests start.
nin--jin Aug 7, 2017
0e24bc5
New build.
nin--jin Aug 30, 2017
752b65f
New mol
nin--jin Sep 16, 2017
62a450e
mol fix
nin--jin Sep 16, 2017
f1d74ff
new mol implementation
nin--jin Sep 23, 2017
e523559
Added TeaVM/Flavour
nin--jin Oct 13, 2017
2e5e1c1
+fixed path
nin--jin Oct 13, 2017
c47e250
Put optimized Flavour example
konsoletyper Oct 14, 2017
b674ae7
Merge pull request #1 from konsoletyper/flavour-opt
nin-jin Oct 14, 2017
050bdab
Update index.html
nin-jin Nov 20, 2017
61fc375
Benchmark improvements: added `complete` step, clicks on different bu…
nin--jin Dec 10, 2017
b119098
Better texts in benchmark.
nin--jin Dec 17, 2017
25d2dac
Added SvelteJS
nin--jin Dec 20, 2017
70baeaa
Added SvelteJS bundles.
nin--jin Dec 20, 2017
e9a24ce
New $mol impl.
nin--jin Dec 21, 2017
037f5b8
new $mol impl.
nin--jin Dec 22, 2017
e3a9f64
More specific events.
nin--jin Mar 2, 2018
ec10bf2
+1
nin--jin Mar 2, 2018
2e66e2a
+1
nin--jin Mar 2, 2018
14040a4
vscode launch
nin--jin Mar 12, 2020
0e0f5eb
Merge branch 'master' of https://github.com/tastejs/todomvc
nin--jin Mar 12, 2020
0876b97
mol up
nin--jin Mar 12, 2020
39215a2
fixed selectors
nin--jin Mar 12, 2020
5f23949
fix
nin--jin Mar 12, 2020
a69835f
New mol version
Nov 17, 2020
4b10075
Update index.html
nin-jin Nov 17, 2020
1308559
Merge branch 'master' of https://github.com/tastejs/todomvc
Nov 17, 2020
2142b63
Merge branch 'master' of github.com:hyoo-ru/todomvc
Nov 17, 2020
e475c54
Fixed mol order
Nov 17, 2020
caccdb9
+effector
Nov 20, 2021
fa8e328
Update index.html
nin-jin Nov 20, 2021
73355a6
bump effector
Nov 20, 2021
00c6669
Merge branch 'master' of github.com:hyoo-ru/todomvc
Nov 20, 2021
5a7e287
mol up
Jan 20, 2022
a2881de
mol up
Apr 11, 2022
47edf74
$mol up
Apr 24, 2022
67a9a93
$mol up
Jun 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// Используйте IntelliSense, чтобы узнать о возможных атрибутах.
// Наведите указатель мыши, чтобы просмотреть описания существующих атрибутов.
// Для получения дополнительной информации посетите: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}\\server.js"
}
]
}
275 changes: 275 additions & 0 deletions benchmark/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,275 @@
<!doctype html>
<html>

<meta charset="utf-8" />

<style>
html , body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
overflow: hidden;
font: 12pt/1.25 "-apple-system", BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@keyframes measure {
from {
outline : 1px solid black;
}
to {
outline : 1px solid white;
}
}

#sandbox {
border: none;
width: 100%;
height: 100%;
}
</style>

<iframe id="sandbox"></iframe>

<script>

if( window.parent === window ) document.location = 'https://bench.hyoo.ru/#bench=' + encodeURIComponent( location.href )

var metaData = {
title : {
'en' : 'ToDoMVC workflow benchmark' ,
'ru' : 'ToDoMVC - производительность работы' ,
} ,
descr : {
'en' : 'Sample applications is [ToDoMVC](https://github.com/hyoo-ru/todomvc/) implementations. Benchmark creates tasks in sequence, toggles completeness and then removes them.' ,
'ru' : 'Варианты реализаций [ToDoMVC](https://github.com/hyoo-ru/todomvc/) приложения для управления списком дел. В тесте замеряется время последовательного создания задач, переключения их завершённости и последующего их удаления.' ,
} ,
samples : {
} ,
params : {
'count' : {
title : {
'en' : 'Count of tasks' ,
'ru' : 'Число задач' ,
},
default : 200 ,
type : 'number' ,
precision : 50 ,
} ,
'blinks' : {
title : {
'en' : 'Complete all count' ,
'ru' : 'Число переключений всех' ,
},
default : 50 ,
type : 'number' ,
precision : 10 ,
}
} ,
steps : {
'start' : {
title : {
'en' : 'Load' ,
'ru' : 'Загрузка' ,
} ,
} ,
'fill' : {
title : {
'en' : 'Creating' ,
'ru' : 'Создание' ,
} ,
} ,
'complete' : {
title : {
'en' : 'Compliting' ,
'ru' : 'Завершение' ,
} ,
} ,
'clear' : {
title : {
'en' : 'Removing' ,
'ru' : 'Удаление' ,
} ,
} ,
} ,
}

var xhr = new XMLHttpRequest
xhr.open( 'get' , '../learn.json' , false )
xhr.send()
var learn = JSON.parse( xhr.responseText )

for( var lib in learn ) {
if( lib === 'templates' ) continue
learn[ lib ].examples.forEach( function( example ) {
if( !/^examples\/[-a-zA-Z0-9_\/]+$/.test( example.url ) ) return

metaData.samples[ example.url.replace( /(^examples\/|\/$)/g , '' ) ] = {
title : { 'en' : learn[ lib ].name + ' ' + example.name.replace( 'Example' , '' ) }
}
} )
}

var sandbox = document.getElementById( 'sandbox' )

var selector = {
adder : '#new-todo,.new-todo,.todo__new,[hyoo_todomvc_add]' ,
adderForm : '#todo-form,.todo-form,#header form' ,
completer : '.toggle-all,#toggle-all,[hyoo_todomvc_head_complete]' ,
dropper : '.destroy,[hyoo_todomvc_task_row_drop]' ,
}

function meta() {
done( metaData )
}

function start( sample ) {
var sandbox = document.getElementById( 'sandbox' )
localStorage.clear()
sandbox.src = 'about:blank'
setTimeout( function() {
var start = Date.now()
sandbox.src = '../examples/' + sample + '/'
sandbox.onload = function() {
step()
function step() {
if( sandbox.contentDocument.querySelector( selector.adder ) ) done( Date.now() - start + ' ms' )
else setTimeout( step , 10 )
}
sandbox.onload = null
}
} )
}

function fill( sample , params ) {
var adder = sandbox.contentDocument.querySelector( selector.adder )
var adderForm = sandbox.contentDocument.querySelector( selector.adderForm )
var i = 1
var start = Date.now()

step()
function step() {
adder.value = 'Something to do ' + i
adder.dispatchEvent( new Event( 'input' , { bubbles : true } ) )
adder.dispatchEvent( new Event( 'change' , { bubbles : true } ) )

var event = new Event( 'keydown' , { bubbles : true } )
event.keyCode = 13
event.which = 13
event.key = 'Enter'
adder.dispatchEvent( event )

var event = new Event( 'keypress' , { bubbles : true } )
event.keyCode = 13
event.which = 13
event.key = 'Enter'
adder.dispatchEvent( event )

var event = new Event( 'compositionend' , { bubbles : true } )
event.keyCode = 13
event.which = 13
event.key = 'Enter'
adder.dispatchEvent( event )

var event = new Event( 'keyup' , { bubbles : true } )
event.keyCode = 13
event.which = 13
event.key = 'Enter'
adder.dispatchEvent( event )

var event = new Event( 'blur' , { bubbles : true } )
adder.dispatchEvent( event )

if( adderForm ) {
var event = new Event( 'submit' , { bubbles : true } )
event.keyCode = 13
event.which = 13
event.key = 'Enter'
adderForm.dispatchEvent( event )
}

if( ++i <= params.count ) setImmediate( step )
else {
sandbox.addEventListener( 'animationend' , end )
requestAnimationFrame( function(){ setTimeout( function() { // wait for message processed
sandbox.style.animation = 'measure .001s'
} ) } )
function end() { // wait for painting ends
done( Date.now() - start + ' ms' )
sandbox.style.animation = ''
sandbox.removeEventListener( 'animationend' , end )
}
}
}
}

function complete( sample , params ) {
var completer = sandbox.contentDocument.querySelector( selector.completer )
var i = 1
var start = Date.now()

step()
function step() {
completer.click()

if( ++i <= params.blinks ) setImmediate( step )
else {
sandbox.addEventListener( 'animationend' , end )
requestAnimationFrame( function(){ setTimeout( function() { // wait for message processed
sandbox.style.animation = 'measure .001s'
} ) } )
function end() { // wait for painting ends
done( Date.now() - start + ' ms' )
sandbox.style.animation = ''
sandbox.removeEventListener( 'animationend' , end )
}
}
}
}

function clear( sample ) {
var start = Date.now()
var index = 0

step()
function step() {
var droppers = sandbox.contentDocument.querySelectorAll( selector.dropper )
if( !droppers.length ) {
sandbox.addEventListener( 'animationend' , end )
requestAnimationFrame( function(){ setTimeout( function() { // wait for message processed
sandbox.style.animation = 'measure .001s'
} ) } )
function end() { // wait for painting ends
done( Date.now() - start + ' ms' )
sandbox.style.animation = ''
sandbox.removeEventListener( 'animationend' , end )
}
return
}

var dropper = droppers[ index++ % droppers.length ]

dropper.dispatchEvent( new MouseEvent( 'mousedown' , { bubbles : true } ) )
dropper.dispatchEvent( new MouseEvent( 'mouseup' , { bubbles : true } ) )
dropper.dispatchEvent( new MouseEvent( 'click' , { bubbles : true } ) )

setImmediate( step )
}
}

function done( result ) {
if( parent === window ) console.log( result )
else parent.postMessage( [ 'done' , result ] , '*' )
}

window.addEventListener( 'message' , function( event ) {
window[ event.data[0] ].apply( null , event.data.slice( 1 ) )
} )

var setImmediate_task
function setImmediate( task ) {
setImmediate_task = task
postMessage( [ 'setImmediate_task' ] , '*' )
}

</script>
4 changes: 4 additions & 0 deletions examples/cyclejs/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["es2015"],
"plugins": ["transform-object-rest-spread"]
}
7 changes: 7 additions & 0 deletions examples/cyclejs/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
; editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = LF
4 changes: 4 additions & 0 deletions examples/cyclejs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.idea/
ignore/
node_modules/
npm-debug.log
22 changes: 22 additions & 0 deletions examples/cyclejs/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2014 André Staltz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

10 changes: 10 additions & 0 deletions examples/cyclejs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
TodoMVC in Cycle.js
===================

TodoMVC example implemented in [Cycle.js](http://cycle.js.org).

[Open the app]( http://cycle.js.org/todomvc-cycle/ )

- - -

To see a version of this codebase using Immutable.js, [click here](https://github.com/cyclejs/todomvc-cycle/pull/9/files).
19 changes: 19 additions & 0 deletions examples/cyclejs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en" data-framework="cycle">
<head>
<meta charset="utf-8">
<title>Cycle • TodoMVC</title>
<link href="node_modules/todomvc-common/base.css" rel="stylesheet">
<link href="node_modules/todomvc-app-css/index.css" rel="stylesheet">
</head>
<body>
<section class="todoapp"></section>
<footer class="info">
<p>Double-click to edit a todo</p>
<p><a href="http://github.com/cyclejs/todomvc-cycle">Source code</a></p>
<p>Created by <a href="http://andre.staltz.com">Andre Staltz</a></p>
</footer>
<script src="node_modules/todomvc-common/base.js"></script>
<script src="js/app.js"></script>
</body>
</html>