Port to Node.js 8.0
Created by: M5oul
Duniter dependencies which handle Node.js 7.0:
- sqlite3
- Node webkit
async module received a big upgrade
@c-geek said we will see later as there is issues using this version.
- Show closed items
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Author Owner
Created by: M5oul
async/await
will be/is integrated on Node.js v7 with V8 Chrome's JavaScript motor integration. - Author Owner
According to your article:
When to start using it?
Node.js v8, the next stable version containing the V8 version that enables async/await operations will be released in April 2017.
We better wait for Node.js 8, which is planned for October 2017.
- Author Owner
Created by: M5oul
Node.js 8.6 is already included on Fedora 27 Beta. I will try it too see how it goes.
- Author Owner
Restricting code to Node 8 would bring several benefits:
Enable ES8/ES2017 features
Native async/await support
This would allow better stack traces, as the polyfill "__awaiter" would be removed and handled directly by NodeJS:
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); };
This code would completely be removed from transpiled JS, and be handled natively by the NodeJS engine.
Better performances
When executing the tests on my machine:
- NodeJS 6: 118" of time execution (~2 minutes)
- NodeJS 8: 95" of time execution (~1,5 minutes)
Which is 20% faster.
Future improvement for PoW code
A new memory sharing mechanism is present in ES8, very useful for JS multithreading, which we do with the proof-of-work code.
This would allow us to remove all the communication code between workers and the main thread, giving more security (only one memory zone to secure), better speed and easier data sharing, cleaner code.
Yet, this feature is not part of Node8 but Node9 or Node10. So it is a future feature.
Edited by Cédric Moreau - Cédric Moreau changed milestone to %1.6.0
changed milestone to %1.6.0
- Cédric Moreau added T-optimization ~174 labels
added T-optimization ~174 labels
- Cédric Moreau assigned to @c-geek
assigned to @c-geek
- Author Owner
I'm already testing the software with NodeJS 8 right now, the Linux Desktop version.
I still need to do it with:
- .deb (Server and Desktop)
- .exe (Windows Desktop)
If it all goes right, I will make a new MR on 1.6 branch.
1 - Owner
@moul already created a MR : !1209 (closed)
- Author Owner
Yes but the content of this is MR is too low, you can close it.
- Cédric Moreau mentioned in commit 1333c2d0
mentioned in commit 1333c2d0
- Cédric Moreau mentioned in commit 5994e648
mentioned in commit 5994e648
- Cédric Moreau mentioned in commit 96e1434a
mentioned in commit 96e1434a
- Cédric Moreau mentioned in commit bffadce1
mentioned in commit bffadce1
- Cédric Moreau removed assignee
removed assignee
- Author Owner
Reopen because of #1230 (closed)
- Author Owner
You be fixed by !1226 (merged).
- Cédric Moreau mentioned in merge request !1228 (merged)
mentioned in merge request !1228 (merged)
- Cédric Moreau closed
closed