⍝ Timing test script for [open]:
⍝
⍝     test 'open'           ⍝ performance timing test.
⍝   1 test 'open'           ⍝ performance timing test (show progress).
⍝
⍝     Set [loops] and [rows] to suit your machine:

    getenv←{⍎⊃(0=⎕nc ⍵)↓ ⍵ '⍺'}             ⍝ get environment variable.

    loops  ← 1000 getenv 'loops'            ⍝ default 1000 loops.
    rows   ← 1000 getenv 'rows'             ⍝ default 1000-row table.
    fields ←   10 getenv 'fields'           ⍝ default 10 fields.

    +ddb.remove'ddb test'                   ⍝ ensure file removed.
0
    defs ← {⍵ 80 10}¨,\fields⍴⎕a            ⍝ field definitions.

    tab←'ddb test' ddb.create defs          ⍝ create table.

    open←{ddb.open'ddb test'}               ⍝ open table.

    {}⎕wa                                   ⍝ compact for consistent test.

    {}{0}∘open¨time ⍳loops                  ⍝ open timing test.

    +ddb.remove tab                         ⍝ remove table.
1
⍝   
⍝   Back to: Contents