electron/atom/common
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
asar Refactoring: use C++11 class member variable initialization 2018-05-22 00:18:38 +02:00
crash_reporter Refactoring: use C++11 class member variable initialization 2018-05-22 00:18:38 +02:00
linux also format missing .cc files 2018-04-18 20:48:45 -04:00
native_mate_converters perf: don't use JSON to send the result of ipcRenderer.sendSync. (#8953) 2018-06-13 17:38:31 +10:00
resources/mac Remove redundant menu item 2017-11-27 17:26:22 +09:00
atom_command_line.cc Fix up #includes to work with both GYP and GN 2018-05-10 13:38:40 -07:00
atom_command_line.h Disallow launching unknown apps via browser client. 2018-01-22 16:49:30 -06:00
atom_constants.cc move pdf viewer behind feature flag 2018-03-20 10:13:17 +03:00
atom_constants.h move pdf viewer behind feature flag 2018-03-20 10:13:17 +03:00
atom_version.h remove unused macro 2018-04-18 20:48:45 -04:00
chrome_version.h Update chrome_version.h 2018-03-20 10:13:17 +03:00
color_util.cc also format missing .cc files 2018-04-18 20:48:45 -04:00
color_util.h Remove const since SkColor is an int 2016-10-11 13:15:27 -07:00
common_message_generator.cc fix include definition errors 2018-04-18 20:48:46 -04:00
common_message_generator.h clang-format atom files 2018-04-18 20:48:45 -04:00
draggable_region.cc also format missing .cc files 2018-04-18 20:48:45 -04:00
draggable_region.h Fix ui/gfx/geometry headers 2015-03-18 09:57:38 +08:00
google_api_key.h clang-format atom files 2018-04-18 20:48:45 -04:00
key_weak_map.h clang-format atom files 2018-04-18 20:48:45 -04:00
keyboard_util.cc also format missing .cc files 2018-04-18 20:48:45 -04:00
keyboard_util.h Assert key and code in keyup input event spec 2016-10-10 09:35:44 -07:00
mouse_util.cc also format missing .cc files 2018-04-18 20:48:45 -04:00
mouse_util.h clang-format atom files 2018-04-18 20:48:45 -04:00
node_bindings.cc perf: don't use JSON to send the result of ipcRenderer.sendSync. (#8953) 2018-06-13 17:38:31 +10:00
node_bindings.h perf: don't use JSON to send the result of ipcRenderer.sendSync. (#8953) 2018-06-13 17:38:31 +10:00
node_bindings_linux.cc also format missing .cc files 2018-04-18 20:48:45 -04:00
node_bindings_linux.h refactor: chromium-style warnings in linux code (#12949) 2018-05-16 14:12:45 -05:00
node_bindings_mac.cc also format missing .cc files 2018-04-18 20:48:45 -04:00
node_bindings_mac.h [chromium-style] override / virtual warnings 2018-04-19 11:12:10 -07:00
node_bindings_win.cc also format missing .cc files 2018-04-18 20:48:45 -04:00
node_bindings_win.h Add a new type of NodeBindings 2017-03-20 12:52:45 -07:00
node_includes.h Fix up #includes to work with both GYP and GN 2018-05-10 13:38:40 -07:00
options_switches.cc Merge pull request #13050 from electron/3.0.0-deprecations 2018-05-30 09:25:36 +02:00
options_switches.h Merge pull request #13050 from electron/3.0.0-deprecations 2018-05-30 09:25:36 +02:00
platform_util.h Implement login helper to manage login item in Mac App Store build 2017-11-17 10:53:09 +09:00
platform_util_linux.cc also format missing .cc files 2018-04-18 20:48:45 -04:00
platform_util_mac.mm clang-format objc files (#12673) 2018-04-20 11:47:04 -07:00
platform_util_win.cc also format missing .cc files 2018-04-18 20:48:45 -04:00