electron/atom/renderer
Thiago de Arruda 6ff111a141 perf: don't use JSON to send the result of ipcRenderer.sendSync. (#8953)
* Don't use JSON to send the result of `ipcRenderer.sendSync`.

- Change the return type of AtomViewHostMsg_Message_Sync from `base::string16`
  to `base::ListValue`
- Adjust lib/browser/api/web-contents.js and /lib/renderer/api/ipc-renderer.js
  to wrap/unwrap return values to/from array, instead of
  serializing/deserializing JSON.

This change can greatly improve `ipcRenderer.sendSync` calls where the return
value contains Buffer instances, because those are converted to Array before
being serialized to JSON(which has no efficient way of representing byte
arrays).

A simple benchmark where remote.require('fs') was used to read a 16mb file got
at least 5x faster, not to mention it used a lot less memory.  This difference
tends increases with larger buffers.

* Don't base64 encode Buffers

* Don't allocate V8ValueConverter on the heap

* Replace hidden global.sandbox with NodeBindings::IsInitialized()

* Refactoring: check NodeBindings::IsInitialized() in V8ValueConverter

* Refactor problematic test to make it more reliable

* Add tests for NaN and Infinity
2018-06-13 17:38:31 +10:00
..
api perf: don't use JSON to send the result of ipcRenderer.sendSync. (#8953) 2018-06-13 17:38:31 +10:00
resources/mac
atom_autofill_agent.cc Refactoring: use C++11 class member variable initialization 2018-05-22 00:18:38 +02:00
atom_autofill_agent.h Refactoring: use C++11 class member variable initialization 2018-05-22 00:18:38 +02:00
atom_render_frame_observer.cc Refactoring: use C++11 class member variable initialization 2018-05-22 00:18:38 +02:00
atom_render_frame_observer.h Refactoring: use C++11 class member variable initialization 2018-05-22 00:18:38 +02:00
atom_render_view_observer.cc also format missing .cc files 2018-04-18 20:48:45 -04:00
atom_render_view_observer.h [chromium-style] override / virtual warnings 2018-04-19 11:12:10 -07:00
atom_renderer_client.cc chore: move more constants to options_switches.h/cc (#13093) 2018-05-29 03:09:51 -05:00
atom_renderer_client.h Refactoring: use C++11 class member variable initialization 2018-05-22 00:18:38 +02:00
atom_sandboxed_renderer_client.cc perf: don't use JSON to send the result of ipcRenderer.sendSync. (#8953) 2018-06-13 17:38:31 +10:00
atom_sandboxed_renderer_client.h [chromium-style] override / virtual warnings 2018-04-19 11:12:10 -07:00
content_settings_observer.cc also format missing .cc files 2018-04-18 20:48:45 -04:00
content_settings_observer.h Separate ContentSettingsClient out from LocalFrameClient 2017-08-15 16:19:20 +03:00
guest_view_container.cc Part I: Move from base::Bind to base::BindOnce and remove unneeded base::Passed (#12661) 2018-04-20 19:55:05 +09:00
guest_view_container.h insertText is deprecated 2017-02-06 10:34:29 -08:00
preferences_manager.cc also format missing .cc files 2018-04-18 20:48:45 -04:00
preferences_manager.h
renderer_client_base.cc Send document-start/end to the right context when contextIsolation=true (#12738) 2018-05-04 23:39:54 -07:00
renderer_client_base.h Send document-start/end to the right context when contextIsolation=true (#12738) 2018-05-04 23:39:54 -07:00
web_worker_observer.cc also format missing .cc files 2018-04-18 20:48:45 -04:00
web_worker_observer.h Insert node integrations into WebWorker 2017-03-20 12:52:45 -07:00