40-db-query-dispatcher-procs.tcl

  • last updated 21 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
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

- simply string comparisons

- use tcl 8.5 extended index format for "lindex" and "lrange"

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

- remove unneeded "expr" in side if-expressions

  1. … 13 more files in changeset.
- get rid of empty_string_p

  1. … 20 more files in changeset.
- cleanup and minor performance improvements

    • -16
    • +13
    ./40-db-query-dispatcher-procs.tcl
  1. … 1 more file in changeset.
- abstract in check for existance of a command whether this is scripted or not

- use a more modern tcl command set

  1. … 12 more files in changeset.
Normalizing string comparison operations into tcl 8.4 operations, enabling byte-code compilation for expressions and many conditionals

    • -23
    • +23
    ./40-db-query-dispatcher-procs.tcl
  1. … 367 more files in changeset.
Merged oacs-5-2 -> oacs-5-3 branches.

  1. … 66 more files in changeset.
Backport 10g recognition patches from HEAD

  1. … 1 more file in changeset.
Fixed bug 2961 by applying Christian Brechbühler's patch

  1. … 1 more file in changeset.
change ad_verify_and_get_user_id to ad_conn user_id, change ad_maybe_redirect_for_registration to auth::require_login, make some db_ and dt_ function -public

    • -35
    • +48
    ./40-db-query-dispatcher-procs.tcl
  1. … 689 more files in changeset.
comment out db_qd_log calls as almost noone will use these anymore and some added appreciable overhead. warn when a proc does not yield a statement name with advice about why, fix the bootstrap version of acs_kernel_id to cache

    • -46
    • +46
    ./40-db-query-dispatcher-procs.tcl
  1. … 1 more file in changeset.
when parsing a xql file fails, it seems appropriate to log this in the error log