electron/atom/common/api
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_messages.h perf: don't use JSON to send the result of ipcRenderer.sendSync. (#8953) 2018-06-13 17:38:31 +10:00
atom_api_asar.cc also format missing .cc files 2018-04-18 20:48:45 -04:00
atom_api_clipboard.cc run clang-format 2018-04-16 15:08:17 -04:00
atom_api_clipboard.h remove html/rtf methods marked for 2.0 2018-02-20 08:41:58 -05:00
atom_api_clipboard_mac.mm Add find text support to clipboard 2016-10-25 14:15:54 +09:00
atom_api_crash_reporter.cc also format missing .cc files 2018-04-18 20:48:45 -04:00
atom_api_key_weak_map.h clang-format atom files 2018-04-18 20:48:45 -04:00
atom_api_native_image.cc remove nativeImage.createFromBuffer() deprecation 2018-05-23 09:43:58 -07:00
atom_api_native_image.h clang-format atom files 2018-04-18 20:48:45 -04:00
atom_api_native_image_mac.mm clang-format objc files (#12673) 2018-04-20 11:47:04 -07:00
atom_api_shell.cc also format missing .cc files 2018-04-18 20:48:45 -04:00
atom_api_v8_util.cc also format missing .cc files 2018-04-18 20:48:45 -04:00
atom_bindings.cc Add process.getHeapStatistics() (#13183) 2018-06-10 22:00:36 +10:00
atom_bindings.h Add process.getHeapStatistics() (#13183) 2018-06-10 22:00:36 +10:00
constructor.h Add LayoutManager/BoxLayout APIs 2018-05-24 15:36:29 +09:00
event_emitter_caller.cc also format missing .cc files 2018-04-18 20:48:45 -04:00
event_emitter_caller.h clang-format atom files 2018-04-18 20:48:45 -04:00
features.cc Better OSR tests (#12817) 2018-05-03 11:10:25 -05:00
locker.cc also format missing .cc files 2018-04-18 20:48:45 -04:00
locker.h Update to API changes of Chrome 51 2016-05-23 10:59:39 +09:00
object_life_monitor.cc also format missing .cc files 2018-04-18 20:48:45 -04:00
object_life_monitor.h Fix context leak in ObjectLifeMonitor. 2017-04-28 11:21:53 -03:00
remote_callback_freer.cc [chromium-style] auto variable type must not deduce to a raw pointer type 2018-04-19 11:10:52 -07:00
remote_callback_freer.h Simplify RemoteCallbackFreer 2016-04-26 16:37:46 +09:00
remote_object_freer.cc also format missing .cc files 2018-04-18 20:48:45 -04:00
remote_object_freer.h clang-format atom files 2018-04-18 20:48:45 -04:00