Upgrade to Pro — share decks privately, control downloads, hide ads and more …

the-evolution-of-garchen-panel.pdf

kmsheng
October 04, 2017
42

 the-evolution-of-garchen-panel.pdf

kmsheng

October 04, 2017
Tweet

Transcript

  1. What is Electron ? • Software Framework • Build cross

    platform desktop apps with JavaScript, HTML, and CSS • Support macOS, Windows ia32 and x64, Linux ( Ubuntu 12.04 and later, Fedora 21, Debian 8 ) • Started at April 11, 2013, created by Cheng Zhao, now developed by Github • Written in C++, Python and JavaScript • Node.js runtime for the backend, Chromium for the frontend
  2. • Open-source web browser project started by Google • Chrome

    and Chromium share the majority of code and features • Have different licensing Chromium
  3. • Newest of the new Chrome features • Not well

    tested • Designed for developers Chrome Canary
  4. Main Process Renderer Process Renderer Process . . . IpcRenderer.send(‘eventName’,

    ‘hello from ipcRenderer’); event.sender.send(‘eventName’, ‘hello from ipcMain’); IpcRenderer.on(‘eventName’, (event, arg) => {}); IpcMain.on(‘eventName’, (event, arg) => {});
  5. What is SQLite ? • Most used database engine in

    the word • Cross-platform • Stand-alone or self-contained • Serverless • Zero-configuration • Written in C ( also a JavaScript port version called sql.js )
  6. Use sql.js or SQLite ? SQLite3 sql.js Performance Fast Slow

    Cross-platform Application Packaging Difficult Easy
  7. • Use SQLite instead of sql.js, since sql.js DID NOT

    meet expectations • Reduce queries, create multiple instances at once instead of creating one by one • Apply correct index on table • Make sure SQLite is built successfully across different OS How to improve write speed ?
  8. Use SQLite instead of sql.js const db = new Trilogy('./file.db',

    { client: 'sql.js' }) npm i sqlite3 const db = new Trilogy('./file.db', { client: 'sqlite3' })
  9. Create multiple instances at once instead of creating one by

    one Actually, SQLite will easily do 50,000 or more INSERT statements per second on an average desktop computer. But it will only do a few dozen transactions per second. Transaction speed is limited by the rotational speed of your disk drive. A transaction normally requires two complete rotations of the disk platter, which on a 7200RPM disk drive limits you to about 60 transactions per second. http://www.sqlite.org/faq.html#q19
  10. Create multiple instances at once instead of creating one by

    one await insert({entry: ‘entry1’}); await batchInsert([ {entry: ‘entry1’}, {entry: ‘entry2’}, {entry: ‘entry3’} ]); await insert({entry: ‘entry2’}); await insert({entry: ‘entry3’});
  11. Create multiple instances at once instead of creating one by

    one INSERT INTO Entry(Entry) VALUES ('enrtry1'); INSERT INTO Entry(Entry) VALUES ('enrtry2'); INSERT INTO Entry(Entry) VALUES ('enrtry3'); BEGIN TRANSACTION; INSERT INTO Entry(Entry) VALUES (‘enrtry1’); INSERT INTO Entry(Entry) VALUES (‘enrtry1’); INSERT INTO Entry(Entry) VALUES (‘enrtry1'); COMMIT;
  12. Apply correct index on table • Make the ORM Trilogy

    able to apply table index on multiple columns • Test if the index is really applied
  13. Test if an index is applied EXPLAIN QUERY PLAN select

    * from Entry where folderId = 1 order by pageNum DESC limit 10 offset 1;
  14. Make sure SQLite is built successfully across different OS •

    Install Visual Studio • Upgrade ASUS X402C Windows 8 to 8.1 • [email protected]: npm prune --production fails with native addon • [windows] Segmentation fault error during packaging
  15. Open Issue Analysis Automatic Packaging / Uploading Automatic Testing Create

    Patch Quality Assurance Publish Release Release Life Cycle