aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/SPMySQLFramework/Source/SPMySQL Private APIs.h
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2013-08-13 23:49:31 +0000
committerrowanbeentje <rowan@beent.je>2013-08-13 23:49:31 +0000
commitef60b2022d50b99e6de78cc301bf71e8b336ae0e (patch)
tree175e38fc968dec070ca8a872f7b87502b62e8c82 /Frameworks/SPMySQLFramework/Source/SPMySQL Private APIs.h
parent80c152501303c0ed7bd530f5e05bc7e5a6fba7f5 (diff)
downloadsequelpro-ef60b2022d50b99e6de78cc301bf71e8b336ae0e.tar.gz
sequelpro-ef60b2022d50b99e6de78cc301bf71e8b336ae0e.tar.bz2
sequelpro-ef60b2022d50b99e6de78cc301bf71e8b336ae0e.zip
Rework table content and custom query data loading and storage for speed increases and lower memory usage:
- Add a new SPMySQLStreamingResultStore class to SPMySQL.framework. This class acts as both a result set and a data store for the accompanying data, storing the row information in a custom format in a custom malloc zone. - Amend SPDataStorage to wrap the new class, so original result information is stored in the one location in the custom format. Any edited information is handled by SPDataStorage for clean separation - Rework table content and custom query data data stores to use the new class. This significantly speeds up data loading, resulting in faster data loads if they weren't previously network constrained, or lower CPU usage otherwise. The memory usage is also lowered, with the memory overhead for many small cells being enormously reduced.
Diffstat (limited to 'Frameworks/SPMySQLFramework/Source/SPMySQL Private APIs.h')
-rw-r--r--Frameworks/SPMySQLFramework/Source/SPMySQL Private APIs.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQL Private APIs.h b/Frameworks/SPMySQLFramework/Source/SPMySQL Private APIs.h
index 50d40eac..37409b36 100644
--- a/Frameworks/SPMySQLFramework/Source/SPMySQL Private APIs.h
+++ b/Frameworks/SPMySQLFramework/Source/SPMySQL Private APIs.h
@@ -95,21 +95,28 @@
- (NSString *)_stringWithBytes:(const void *)bytes length:(NSUInteger)length;
- (void)_setQueryExecutionTime:(double)theExecutionTime;
-- (id)_getObjectFromBytes:(char *)bytes ofLength:(NSUInteger)length fieldType:(unsigned int)fieldType fieldDefinitionIndex:(NSUInteger)fieldIndex;
+
+@end
+
+// SPMySQLResult Data Conversion Private API
+@interface SPMySQLResult (Data_Conversion_Private_API)
+
++ (void)_initializeDataConversion;
+- (id)_getObjectFromBytes:(char *)bytes ofLength:(NSUInteger)length fieldDefinitionIndex:(NSUInteger)fieldIndex previewLength:(NSUInteger)previewLength;
@end
/**
* Set up a static function to allow fast calling of SPMySQLResult data conversion with cached selectors
*/
-static inline id SPMySQLResultGetObject(SPMySQLResult* self, char* bytes, NSUInteger length, unsigned int fieldType, NSUInteger fieldIndex)
+static inline id SPMySQLResultGetObject(SPMySQLResult* self, char* bytes, NSUInteger length, NSUInteger fieldIndex, NSUInteger previewLength)
{
- typedef id (*SPMySQLResultGetObjectMethodPtr)(SPMySQLResult*, SEL, char*, NSUInteger, unsigned int, NSUInteger);
+ typedef id (*SPMySQLResultGetObjectMethodPtr)(SPMySQLResult*, SEL, char*, NSUInteger, NSUInteger, NSUInteger);
static SPMySQLResultGetObjectMethodPtr cachedMethodPointer;
static SEL cachedSelector;
- if (!cachedSelector) cachedSelector = @selector(_getObjectFromBytes:ofLength:fieldType:fieldDefinitionIndex:);
+ if (!cachedSelector) cachedSelector = @selector(_getObjectFromBytes:ofLength:fieldDefinitionIndex:previewLength:);
if (!cachedMethodPointer) cachedMethodPointer = (SPMySQLResultGetObjectMethodPtr)[self methodForSelector:cachedSelector];
- return cachedMethodPointer(self, cachedSelector, bytes, length, fieldType, fieldIndex);
+ return cachedMethodPointer(self, cachedSelector, bytes, length, fieldIndex, previewLength);
}