]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
docs: add a note about further optimizing text array loading
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 6 Dec 2022 12:40:27 +0000 (13:40 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 10 Dec 2022 13:02:58 +0000 (13:02 +0000)
psycopg_c/psycopg_c/types/array.pyx

index 8e787cd67d824bee0f75ef850be4acc02c72c6fe..9abaef9ffefc7c66415da1ca7a7e86e66686fbd1 100644 (file)
@@ -85,6 +85,10 @@ cdef object _array_load_text(
             raise e.DataError("malformed array: no '=' after dimension information")
         buf += 1
 
+    # TODO: further optimization: pre-scan the array to find the array
+    # dimensions, so that we can preallocate the list sized instead of calling
+    # append, which is the dominating operation
+
     cdef list stack = []
     cdef list a = []
     rv = a