diff options
author | rowanbeentje <rowan@beent.je> | 2009-11-28 22:02:25 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-11-28 22:02:25 +0000 |
commit | 4fa50e035c6bebb0353e1aeb3239fe5f0500d150 (patch) | |
tree | f25201cfacfce8e4ecf16fbd32d35c802e088d3c | |
parent | 657966e2c2b37a988b145813e1787af4e6a962ad (diff) | |
download | sequelpro-4fa50e035c6bebb0353e1aeb3239fe5f0500d150.tar.gz sequelpro-4fa50e035c6bebb0353e1aeb3239fe5f0500d150.tar.bz2 sequelpro-4fa50e035c6bebb0353e1aeb3239fe5f0500d150.zip |
- Make a change to the area covered by threading locks in MCPStreamingConnection for a ~10-15% speedup in CPU-bound loops (eg data sets with lots of rows but little data) by reducing lock contention. (To be tested against #463)
-rw-r--r-- | Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m b/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m index 4093b2a4..d675cebc 100644 --- a/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m +++ b/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m @@ -415,9 +415,6 @@ for (i = 0; i < mNumOfFields; i++) rowDataLength += fieldLengths[i]; - // Lock the data mutex - pthread_mutex_lock(&dataCreationLock); - // Initialise memory for the row and set a NULL pointer for the next item newRowStore = malloc(sizeOfLocalRowData); newRowStore->nextRow = NULL; @@ -438,7 +435,8 @@ // Set up and copy in the field lengths newRowStore->dataLengths = memcpy(malloc(sizeOfDataLengths), fieldLengths, sizeOfDataLengths); - // Lock the data free mutex + // Lock both mutexes + pthread_mutex_lock(&dataCreationLock); pthread_mutex_lock(&dataFreeLock); // Add the newly allocated row to end of the storage linked list |