Browse Source

Increase Windows IPC buffer size to 1 megabyte for faster reading/writing of large message blocks

JoshEngebretson 9 years ago
parent
commit
f237620727

+ 2 - 2
Source/Atomic/IPC/IPCWindows.cpp

@@ -42,7 +42,7 @@ namespace Atomic
 static const wchar_t kPipePrefix[] = L"\\\\.\\pipe\\";
 // start with 1 megabyte of buffer, this will grow if a request exceeds this size
 // however, it will block during resize
-static const int kPipeBufferSz = 1024 * 1024;
+static const int kPipeBufferSz = ATOMIC_WINDOWS_IPC_BUFFER_SIZE;
 static LONG g_pipe_seq = 0;
 
 HANDLE PipePair::OpenPipeServer(const wchar_t* name, bool read)
@@ -215,7 +215,7 @@ void PipeWin::ReaderThread::ThreadFunction()
             continue;
 
         DWORD bytesRead = 0;
-        if (TRUE == ::ReadFile(pipeWin_->pipeRead_, &buf_[0], 4096, &bytesRead, NULL))
+        if (TRUE == ::ReadFile(pipeWin_->pipeRead_, &buf_[0], ATOMIC_WINDOWS_IPC_BUFFER_SIZE, &bytesRead, NULL))
         {
             readSize_ = (unsigned) bytesRead;
         }

+ 5 - 2
Source/Atomic/IPC/IPCWindows.h

@@ -32,6 +32,8 @@
 namespace Atomic
 {
 
+#define ATOMIC_WINDOWS_IPC_BUFFER_SIZE 1048576
+
 class PipePair {
 
 public:
@@ -75,7 +77,7 @@ private:
 
         ReaderThread(PipeWin* pipeWin) : pipeWin_(pipeWin), readSize_(0)
         {
-            buf_.Resize(4096);
+            buf_.Resize(ATOMIC_WINDOWS_IPC_BUFFER_SIZE);
         }
 
         void Kill();
@@ -97,7 +99,8 @@ private:
 
 class PipeTransport : public PipeWin {
 public:
-    static const size_t kBufferSz = 4096;
+
+    static const size_t kBufferSz = ATOMIC_WINDOWS_IPC_BUFFER_SIZE;
 
     bool Send(const void* buf, size_t sz) {
         return Write(buf, sz);

+ 2 - 2
Source/AtomicWebView/WebBrowserHost.cpp

@@ -130,8 +130,8 @@ WebBrowserHost::WebBrowserHost(Context* context) : Object (context)
     CefSettings settings;
     settings.windowless_rendering_enabled = 1;
 
-    // disable default background
-    settings.background_color = 0;
+    // default background is white, add a setting
+    // settings.background_color = 0;
 
     if (productVersion_.Length())
     {