40-db-query-dispatcher-procs.tcl

  • last updated 5 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
reduce the number of locks (nsv-accesses) for OACS_FULLQUERIES by a factor of 3 when NaviServer is used.

OACS_FULLQUERIES is one of the 3 most intensively locked nsv arrays for

busy implementation

    • -20
    • +52
    ./40-db-query-dispatcher-procs.tcl
reduce visibility of internal functions

move function db_current_rdbms to acs-bootstrap installer to improve code locality

  1. … 1 more file in changeset.
Cleanup of low-level DB-interace: use dict instead of list with fixed positions

VS: ----------------------------------------------------------------------

    • -28
    • +48
    ./40-db-query-dispatcher-procs.tcl
  1. … 3 more files in changeset.
Fix for issue #3442 to support range types in .xql files

PostgreSQL supports range types since 9.5. When using range types,

square braces have to be used in SQL statements. Since OpenACS uses

always Tcl substitution in .xql files, and OpenACS does NOT allow

backslash substitution in these files, square brackets could not be

escaped and therefore not be used in .xql files so far. This change

allows now a developer to deactivate the substitution by passing

e.g. "-subst none" to the db_* command using the .xql file. Valid

values for "-subst" are "all", "none", "vars", and "commands", default

is "all" which is exactly the behavior of before. Therefore, this

change is fully backward compatible.

  1. … 3 more files in changeset.
reduce the size of the public interface

    • -10
    • +10
    ./40-db-query-dispatcher-procs.tcl
  1. … 2 more files in changeset.
whitespace changes: break overlong lines

    • -150
    • +176
    ./40-db-query-dispatcher-procs.tcl
make clear from the name that db_qd_prepare_queryfile_content is intended to be used in different packages

  1. … 2 more files in changeset.
Make proc public (it is used in a test is acs-tcl)

Complies with acs-api-browser.callgraph__bad_calls

Whitespace cleanup

    • -69
    • +69
    ./40-db-query-dispatcher-procs.tcl
improve spelling

    • -10
    • +12
    ./40-db-query-dispatcher-procs.tcl
  1. … 4 more files in changeset.
Prefer 'namespace which' over 'info commands', as it is faster (on local tests, around 2x) and returns a single value. Many thanks to Nathan Coulter.

  1. … 58 more files in changeset.
introduced "ad_file" as a means to avoid unexpected tilde substitution in file names

  1. … 50 more files in changeset.
improve spelling

  1. … 3 more files in changeset.
improve spelling

  1. … 2 more files in changeset.
improve spelling

  1. … 8 more files in changeset.
Revert massive replacement of empty list creation sentences. The use of '[list]' instead of '{}' adds semantics that could be used for performance improvements in the future, such as using a different internal representation. There is already work in this direction, avoiding the generation of the string representation during comparison of empty strings (huge thanks to Stefan Sobernig for the pointer: https://core.tcl.tk/tcl/info/44527c632ed609c2).

  1. … 475 more files in changeset.
Rework variable assigning loops (set -> lassign) + Whitespace changes

  1. … 13 more files in changeset.
Prefer '{}' to '[list]' when creating empty lists

  1. … 71 more files in changeset.
merged changes from the oacs-5-9 branch and resolved conflicts

    • -16
    • +16
    ./40-db-query-dispatcher-procs.tcl
  1. … 7834 more files in changeset.
Fix spelling errors, use OpenACS

  1. … 6 more files in changeset.
- modernize tcl

- add missing doc string

ad_proc reform:

- use nsf::proc for defining ad_procs, when nsf::proc is available

- nsf::proc is part of the environment of XOTcl2 and provides

an efficient, C-implemented argument parser that can replace

the scripted *__arg_parser of OpenACS.

- The benefits are performance and reduced memory consumption.

* Simple functions (where the calling overhead was a large

part of the execution times can become several times faster

(e.g. db_name is 3x faster, cookie handling is 2x faster),

for functions with much db-activities the percentage will

be less.

* The memory consumption (RSS) of a site like OpenACS.org

is reduced by about 15%.

NEW (with nsf::proc)

::ad_get_cookie x: 10.93 microseconds per iteration

::ad_get_cookie ad_session_id: 21.95 microseconds per iteration

::dt_systime: 24.89 microseconds per iteration

::db_name: 8.70 microseconds per iteration

::db_string dbqd.null.g "select version() from dual": 316.66 microseconds per iteration

::ad_convert_to_html "hello world": 102.29 microseconds per iteration

OLD (without nsf::proc)

::ad_get_cookie x: 19.42 microseconds per iteration

::ad_get_cookie ad_session_id: 30.10 microseconds per iteration

::dt_systime: 27.55 microseconds per iteration

::db_name: 32.28 microseconds per iteration

::db_string dbqd.null.g "select version() from dual": 366.69 microseconds per iteration

::ad_convert_to_html "hello world": 160.51 microseconds per iteration

======================================================================

proc mtime cmd {set c 5000

set t [time [list time $cmd $c]];

regexp {^(-?[0-9]+) +} $t _ mS1;

set ms [expr {$mS1*1.0/$c}];

return "[format %6.2f $ms] microseconds per iteration"

}

set tests {

{::ad_get_cookie x} {::ad_get_cookie ad_session_id} {::dt_systime}

{::db_name} {::db_string dbqd.null.g "select version() from dual"}

{::ad_convert_to_html "hello world"}

}

foreach t $tests {append ::_ $t ": " [mtime $t] \n}

set ::_

======================================================================

  1. … 9 more files in changeset.
Merging back to HEAD branch oacs-5-8 (using tag vg-merge-oacs-5-8-from-20141027).

    • -25
    • +41
    ./40-db-query-dispatcher-procs.tcl
  1. … 2547 more files in changeset.
- white space change: replace tabs by spaces

    • -11
    • +18
    ./40-db-query-dispatcher-procs.tcl
  1. … 3 more files in changeset.
- add error reporting to package reloader (many thanks to Andrew Helsley, see: http://openacs.org/forums/message-view?message_id=4166397)

  1. … 4 more files in changeset.
- use $::acs::rootdir rather than [acs_root_dir] or [get_server_root]

  1. … 13 more files in changeset.
- reduce number of remaining "string equal" operations

  1. … 1 more file in changeset.
- use "in" operator instead of lsearch