UWP Create table very slow

Hello @Sander - as @developernotes mentioned, the reason that the statement is processing slowly is because of the Key Deviation process (for context, Key Derivation is a security feature that hardens SQLCipher databases against brute force, dictionary, and pre-computation attacks). The reason you are seeing it slow down the create table statement is that key deviation occurs on the first access of the database after the key is set - in practice this means the first time the connection is used, not when the connection is opened.

If you were to use a single connection, created outside of the loop, you would notice that the first table creation is slower than all subsequent calls. Please give this a try.

Alternately, you could, for the purposes of testing, disable key derivation by using a test key with RAW key semantics. Try passing this value into the SQLitePlatformWinRT constructor as the key: "x'2DD29CA851E7B56E4697B0E1F08507293D761A05CE4D1B628663F411A8086D99'". You should find that SQLCipher skips key derivation and the statement runs faster.

Finally, it is also possible to reduce the key derivation rounds, which would speed things up considerably. However, we recommend against that in almost all cases, and instead recommend that applications avoidopening and closing connections when using SQLCipher, in accordance with the applicable performance tuning recommendations.