From: Daniele Varrazzo Date: Tue, 6 Dec 2022 12:40:27 +0000 (+0100) Subject: docs: add a note about further optimizing text array loading X-Git-Tag: 3.1.5~12^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=edc0305dad292f7ed45ac76d99047719fcacbf02;p=thirdparty%2Fpsycopg.git docs: add a note about further optimizing text array loading --- diff --git a/psycopg_c/psycopg_c/types/array.pyx b/psycopg_c/psycopg_c/types/array.pyx index 8e787cd67..9abaef9ff 100644 --- a/psycopg_c/psycopg_c/types/array.pyx +++ b/psycopg_c/psycopg_c/types/array.pyx @@ -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