iOS sqlite3 encryption/decryption performance -
we trying replace our own aes implementation use standard ios aes implementation (see will our app fips 140-2 compliant if use our own aes algorithm implementation?). original aes implementation encrypts , decrypts on source data buffer, no new allocation/free. standard ios aes implementation, have malloc memory destination data buffer dynamically encrypt/decrypt data. worried frequent memory allocation , free result in memory fragmentation. current memory allocation size 1k 8k bytes (depending on ios disk sector size, fixed on 1 particular device), should times of 1k. allocation/free mixed memory allocation of other size, worried create lot of memory fragmentation.
one way solve use local variable fixed size (really sqlite3 page size). problem page size range 1k 8k (depending on ios disk sector size, not sure if ios device reach 8k though) on different devices, mean have allocate 8k local buffer every time since need assign size @ compile time. or allocate smaller local buffer such 2k handle majority cases (at iphone, 1k), if data buffer bigger 2k, use dynamic allocation. seems not ideal well.
should worry here? maybe other standard encrypted sqlite3 implementation doing frequent memory allocation/free, not worse here? if know insight, please shed lights here. appreciated.
Comments
Post a Comment