huge speedup for executing SQL with lots of bind variables#115
Open
GitMensch wants to merge 3 commits intoopensourcecobol:developfrom
Open
huge speedup for executing SQL with lots of bind variables#115GitMensch wants to merge 3 commits intoopensourcecobol:developfrom
GitMensch wants to merge 3 commits intoopensourcecobol:developfrom
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Member
|
Thank you for the pull request. I don't have any particular problems and think it's a good change. The problem seems to be that the definition for MAX_DIGITS is missing. Is it defined somewhere? |
60de243 to
366fb24
Compare
366fb24 to
b921088
Compare
Contributor
Author
|
Pushed with included changes to COMP-3 and DISPLAY / NATIONAL, now including |
b921088 to
cc641cb
Compare
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, leading to huge speedup for executing SQL with lots of bind variables (nearly all time for binding was spent here before)
…memset instead of free + malloc) This drops the amount memory allocation/free to the maximum amount of binding variables used. A run of 8 seconds doing 5000 DB operations previously had 1,945,796 allocations via new_sql_var() and is now down to 426, reducing instructions and cycles executed in the test case by 20% as well.
* prefer local buffers over temporary mallocs * only space-pad PIC X/PIC N instead of space-fill then overwrite
cc641cb to
9c82e63
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.