huge speedup for executing SQL with lots of bind variables #115
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
dblib/ocesql.c (init_sql_var_list, reset_sql_var_list, add_sql_var_list, add_sql_res_var_list): remove the need to iterate over the complete SQLVARLIST of _sql_var_lists and _sql_res_var_lists by saving the pointer of the last entry, fixes #84
before this change a relative simple COBOL program creating a report from ~5000 DB reads had 60% of its cpu-cost in libocesql (mostly in the
add_sql_res_var_list()
function), while libpg had 6% (checked withperf record
).After this change liboceql is down to 12% and libpg using 16%
Setting to a draft for possible more performance-related follow-up changes.