acs-tcl-test-procs.tcl

  • last updated 9 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
replace "expr" by "incr"

improve testcases by removing useless expr commands

  1. … 5 more files in changeset.
Port from downstream cache transaction logics and fix automated test as now db_transaction will return 0 instead of the empty string (and no particular return value should be assumed)

  1. … 1 more file in changeset.
Expect other kinds of tcl booleans in the test

Fix typos

  1. … 3 more files in changeset.
Fix typo (db_list_of_list -> db_list_of_lists)

  1. … 2 more files in changeset.
fix more typos

  1. … 4 more files in changeset.
Fix even more typos

  1. … 29 more files in changeset.
Fix typos

  1. … 4 more files in changeset.
Fix more typos

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

  1. … 7834 more files in changeset.
Standardize spelling of names of products (Tcl, AOLserver, PostgreSQL, NaviServer)

  1. … 43 more files in changeset.
Improve robustness of "file delete" operations

  1. … 25 more files in changeset.
- move test cases from utility procs into regression test

  1. … 1 more file in changeset.
- add editor hints to keep spaces/tabs in the furture more consistent

  1. … 754 more files in changeset.
- remove globals for errorInfo/errorCode and use namespace qualifiers instead

  1. … 12 more files in changeset.

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).

  1. … 2547 more files in changeset.
- simplify code

  1. … 2 more files in changeset.
- don't use backslash in multiline expressions

- make long expressions more uniform and more readable

- use "in" or not in (ni) operator instead of lsearch

- brace expressions to allow for tcl compilation

- bump version number

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

  1. … 9 more files in changeset.
- fixing a wierd interaction between a db_foreach and db_transaction, which leads to wierd values in parameters. Moving from db_foreach to db_list_of_lists repairs the test case.

Added a test for global parameter set/get value.

Added test case

Added procedure to check if a user is actually registered. We should probably change auth::require_login to check if the user is registered instead of just checking for the existance of the cookie

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

  1. … 367 more files in changeset.
Added acs_object::package_id procedure to retrieve the package_id along with testcase

  1. … 2 more files in changeset.
Replacing 'limit 0' with 'person_id=1 and person_id=2' so it can be run on both pg and oracle

fixing some stuff with parameters test, when you change those randomly strange things can happen! will be good to revert stuff

Added documentation to proc.