A optimized version of normalize function in C. user/dsy/normalize_in_c
authorSwenyu Duan <dsy@sina.com>
Thu, 5 Jul 2012 13:25:48 +0000 (09:25 -0400)
committerSwenyu Duan <dsy@sina.com>
Thu, 5 Jul 2012 13:43:47 +0000 (09:43 -0400)
commit70b7c16010afef16a75eceb5ba1aa51143ba4057
treeff0ca5f454e2e706c6f2f8104f5577f5cc3a44a9
parent9da882b9483a4ff0678a8c3b5570318da59e9fd7
A optimized version of normalize function in C.
In preivous version of normalize function. The norm2_getInstance function
is being called each time calls the normalize function. This function will
read in some really large file to memory which will be a huge consumption in
 time. In the new implementation, this function is moved to a PG_fini
 function which will be called when the extension's shared library is loading
into the memory. In this way, the initialized normalizer will could be shared
as a global variable instead of loading it in each normalize operation.
Besides it, some of unneccessary memory allocation function is also removed.
Signed-off-by: Swenyu Duan <dsy@sina.com>
Open-ILS/src/sql/Pg/extensions/normalize.functions_in_c.c