(if vlisp-optimiser (vlisp-optimiser nil)) ;; disable VLisp-Optimiser, if present

;;-----  Define pathes + files -----
(setq benchfile (findfile "Bench.lsp")) ;; find this file
(if (not benchfile)
  (progn
    (alert "* Error : can not find 'Bench.lsp' !\n\nAdd a Support Path for folder containing 'Bench.lsp'")
    (exit)
  )
)

;; determine root path
(setq $BenchRootFolder nil)
(setq pos (strlen benchfile))
(while (and (> pos 0) (not $BenchRootFolder))
  (setq poschar (substr benchfile pos 1))
  (if (or (= poschar "\\") (= poschar "/"))
    (setq $BenchRootFolder (substr benchfile 1 pos))
  )
  (setq pos (1- pos))
)

;;----- Log Folders ---
(setq $BenchLogsFolder (strcat $BenchRootFolder "BenchLogs"))
(setq $BenchTempFolder (strcat $BenchRootFolder "BenchTemp"))

(if (not $benchcyclespertest) (setq $benchcyclespertest 2)) ;; repeat each bench 2 times (for proper average)
(if (not $benchcyclesfactor)  (setq $benchcyclesfactor  1)) ;; to increase/decrease the number of bench loops : > 1 increase < 1 decrease

;;----- create + test presence of Logs folder -----
(if vl-mkdir (vl-mkdir $BenchLogsFolder)) ;; create if vl-mkdir is available
(if (not (findfile $BenchLogsFolder))
  (progn
    (setq $BenchLogsFolder (getvar "tempprefix"))
    (alert "* Error : can not find or create sub-folder '/BenchLogs' !\n\nPlease create sub-folder 'BenchLogs' manually.\n\nUsing <TEMPPREFIX> folder instead.")
  )
)
;;----- create + test presence of Temp folder -----
(if vl-mkdir (vl-mkdir $BenchTempFolder)) ;; create if vl-mkdir is available
(if (not (findfile $BenchTempFolder))
  (progn
    (setq $BenchTempFolder (getvar "tempprefix"))
    (alert "* Error : can not find or create sub-folder '/BenchTemp' !\n\nPlease create sub-folder 'BenchTemp' manually.\n\nUsing <TEMPPREFIX> folder instead.")
  )
)

;;----- Log Folders ---
(setq $BenchLogsFolder (strcat $BenchLogsFolder "/"))
(setq $BenchTempFolder (strcat $BenchTempFolder "/"))

(setq $cadplatform "-Win")
(if (= wcmatch (strcase (getvar "platform")) "*LINUX*") (setq $cadplatform "-Lnx"))
(if (= wcmatch (strcase (getvar "platform")) "*OSX*")   (setq $cadplatform "-Mac"))
(if (= wcmatch (strcase (getvar "platform")) "*MAC*")   (setq $cadplatform "-Mac"))
(setq $cadsystem  (strcase (getvar "program")))
(setq $cadversion (atof (getvar "acadver")))

;;----- Log Files -----
(setq $logfilename         (strcat $BenchLogsFolder $cadsystem $cadplatform "-Lisp-Benchmarks.log"))
(setq $logfilename_all     (strcat $BenchLogsFolder $cadsystem $cadplatform "-Lisp-Benchmarks-ALL.log"))
(setq $logfilename_s       (strcat $BenchLogsFolder $cadsystem $cadplatform "-Lisp-Benchmarks-ST.log"))
(setq $logfilename_sv      (strcat $BenchLogsFolder $cadsystem $cadplatform "-Lisp-Benchmarks-ST-VL.log"))
(setq $logfilename_vl      (strcat $BenchLogsFolder $cadsystem $cadplatform "-Lisp-Benchmarks-VL.log"))
(setq $logfilename_vla     (strcat $BenchLogsFolder $cadsystem $cadplatform "-Lisp-Benchmarks-VLA.log"))
(setq $logfilename_vlafast (strcat $BenchLogsFolder $cadsystem $cadplatform "-Lisp-Benchmarks-VLA-FastCom.log"))
(setq $logfilename_vlax    (strcat $BenchLogsFolder $cadsystem $cadplatform "-Lisp-Benchmarks-VLAX.log"))
(setq $logfilename_vle     (strcat $BenchLogsFolder $cadsystem $cadplatform "-Lisp-Benchmarks-VLE.log"))
(setq $logfilename_v       (strcat $BenchLogsFolder $cadsystem $cadplatform "-Lisp-Benchmarks-VL-VLA_VLAX.log"))
(setq $logfilename_fas     (strcat $BenchLogsFolder $cadsystem $cadplatform "-Lisp-Benchmarks-FAS-DES.log"))
(setq $logfilename_user    (strcat $BenchLogsFolder $cadsystem $cadplatform "-Lisp-Benchmarks-USER.log"))
(setq $logfilename_opt     (strcat $BenchLogsFolder $cadsystem $cadplatform "-Lisp-Benchmarks-Optimizer.log"))

;;----- DEFINE INCLUSION LIST -----
;;(setq $benchcyclespertest 1)
(setq $includebenches
  (list

;"OPTIMIZER (/= x nil)"
;"OPTIMIZER (=  x nil)"
;"OPTIMIZER (eq x nil)"
;"OPTIMIZER (equal x nil)"
;"OPTIMIZER (load <file>)"
;"OPTIMIZER (progn <expr>)"
;"OPTIMIZER (cdr (assoc (entget)))"
;"OPTIMIZER (reverse (cdr (reverse lst)))"
;"OPTIMIZER (cdr (assoc x lst))"
;"OPTIMIZER (nth 0 lst)"
;"OPTIMIZER (nth 5 lst)"
;"OPTIMIZER (nth 9 lst)"
;"OPTIMIZER (vlax-get-property)"

  )
)

;;----- DEFINE EXCLUSION LIST -----
(setq cadsystem  (strcase (getvar "program")))
(setq cadversion (atof (getvar "acadver")))

;;---- EXCLUDES FOR ALL SYSTEMS ---
(setq $excludebenches
  (append $excludebenches
    (list
      "GETCFG"
      "SETCFG"
      "PRINC"
      "PRINT"
      "PRIN1"
      "PROMPT"
      "CVUNIT"
      "GRVECS"            ;; Acad has a strange performance problem here
      "SSNAMEX"           ;; Acad always crashes here
      ;;---------------
      "WRITE-CHAR-SCREEN" ;; very slow in Bricscad - but this function is more exotic
      "GRDRAW"            ;; extremely slow in all systems
      ;;---------------
      "ENTUPD"            ;; extremely slow in BricsCAD V14, as (entupd) does real screen updates
    )
  )
)

;;----- EXCLUDES FOR BRICSCAD ------
(if (= cadsystem "BRICSCAD")
  (progn
    (if (< (atoi (getvar "_vernum")) 12)  ;; fixed since V12
      (setq $excludebenches (list "DICTIONARY"))
    )
  )
)

;;----- EXCLUDES FOR ZWCAD ---------
(if (= cadsystem "ZWCAD")
  (setq $excludebenches (list "ATOMS-FAMILY 1" "GRDRAW" "GRVECS"
                              "VL-DOC-SET" "VL-DOC-REF" "VL-MEMBER-IF-NOT" "VL-SYMBOLP" "VL-SYMBOL-VALUE"
                              "VL-FILE-SYSTIME" "VL-FILE-SIZE" "VL-FILE-RENAME" "VL-BB-SET" "VL-BB-REF"
                              "VL-FILENAME-MKTEMP" "VL-FILE-COPY")
  )
)
;;----- EXCLUDES FOR GstarCAD ------
;(if (= cadsystem "GCAD")
;  (setq $excludebenches (list 
;  )
;)

;;----- EXCLUDES FOR AUTOCAD -- ----
(if (or (= cadsystem "ACAD") (= cadsystem "ACLT") (= cadsystem "ACADLT"))
  (if (= cadversion 16.2)
    (setq $excludebenches
      (append $excludebenches
        (list
;          "ENTUPD"  ;; bug in ARX 16.2 - ads_entupd() hangs
        )
      )
    )
  )
)


;;========================================================
;;================= The Benchmark Modules ================
;;========================================================

(setq BenchModules
 '(
    ;;========== STANDARD Functions ============
    ;;----- operator functions -----
    ("ST" "Benches\\operator-equal.lsp"     ("OPERATOR (=)"   't_operator_equal     500) )
    ("ST" "Benches\\operator-notequal.lsp"  ("OPERATOR (/=)"  't_operator_notequal  500) )
    ("ST" "Benches\\operator-lt.lsp"        ("OPERATOR (<)"   't_operator_lt        750) )
    ("ST" "Benches\\operator-le.lsp"        ("OPERATOR (<=)"  't_operator_le        750) )
    ("ST" "Benches\\operator-gt.lsp"        ("OPERATOR (>)"   't_operator_gt        750) )
    ("ST" "Benches\\operator-ge.lsp"        ("OPERATOR (>=)"  't_operator_ge        750) )
    ("ST" "Benches\\operator-lognot.lsp"    ("OPERATOR (~)"   't_operator_lognot    750) )
    ("ST" "Benches\\operator-incr.lsp"      ("OPERATOR (1+)"  't_operator_incr      750) )
    ("ST" "Benches\\operator-decr.lsp"      ("OPERATOR (1-)"  't_operator_decr      750) )
    ;;---------------------------------
    ("ST" "Benches\\abs.lsp"                ("ABS"       't_abs      1000) )
    ("ST" "Benches\\and.lsp"                ("AND"       't_and      1500) )
    ("ST" "Benches\\or.lsp"                 ("OR"        't_or       1500) )
    ("ST" "Benches\\angle.lsp"              ("ANGLE"     't_angle    1000) )
    ("ST" "Benches\\angtof.lsp"             ("ANGTOF"    't_angtof     75) )
    ("ST" "Benches\\angtos.lsp"             ("ANGTOS"    't_angtos     75) )
    ("ST" "Benches\\append.lsp"             ("APPEND"    't_append     50) )
    ("ST" "Benches\\apply.lsp"              ("APPLY"     't_apply     500) )
    ("ST" "Benches\\apply-andor.lsp"        ("APPLY (and)"    't_applyand    100) ("APPLY (or)" 't_applyor 100))
    ("ST" "Benches\\apply-mapcar.lsp"       ("APPLY (mapcar)" 't_applymapcar 200))
    ("ST" "Benches\\ascii.lsp"              ("ASCII"     't_ascii    1000) )
    ("ST" "Benches\\assoc.lsp"              ("ASSOC"     't_assoc     500) )
    ("ST" "Benches\\atan.lsp"               ("ATAN"      't_atan      750) )
    ("ST" "Benches\\atoi-atof.lsp"          ("ATOI"      't_atoi      750) ("ATOF" 't_atof 750) )
    ("ST" "Benches\\atomsfamily.lsp"        ("ATOMS-FAMILY 0"      't_atoms0      25)
                                            ("ATOMS-FAMILY 1"      't_atoms1      25)
                                            ("ATOMS-FAMILY 0 REFS" 't_atoms0refs 500)
                                            ("ATOMS-FAMILY 1 REFS" 't_atoms1refs 500)
    )
    ("ST" "Benches\\strlsort.lsp"           ("ACAD_STRLSORT"       't_acadstrlsort 50) )

    ("ST" "Benches\\boole.lsp"              ("BOOLE"     't_boole    1000) )

    ("ST" "Benches\\car.lsp"                ("CAR"       't_car      1000) )
    ("ST" "Benches\\caar.lsp"               ("CAAR"      't_caar     1000) )
    ("ST" "Benches\\caaar.lsp"              ("CAAAR"     't_caaar    1000) )
    ("ST" "Benches\\cdr.lsp"                ("CDR"       't_cdr      1000) )
    ("ST" "Benches\\cddr.lsp"               ("CDDR"      't_cddr     1000) )
    ("ST" "Benches\\cdddr.lsp"              ("CDDDR"     't_cdddr    1000) )
    ("ST" "Benches\\chr.lsp"                ("CHR"       't_chr       500) )
    ("ST" "Benches\\command.lsp"            ("COMMAND"   't_command    40) )
    ("ST" "Benches\\cons.lsp"               ("CONS"      't_cons      750) )
    ("ST" "Benches\\cos.lsp"                ("COS"       't_cos      1000) )
    ("ST" "Benches\\cvunit.lsp"             ("CVUNIT"    't_cvunit    100) )

    ("ST" "Benches\\defun.lsp"              ("DEFUN"      't_defun       500) )
    ("ST" "Benches\\dictadd.lsp"            ("DICTADD"    't_dictadd     250) )
    ("ST" "Benches\\dictnext.lsp"           ("DICTNEXT"   't_dictnext    250) )
    ("ST" "Benches\\dictrename.lsp"         ("DICTRENAME" 't_dictrename  250) )
    ("ST" "Benches\\dictsearch.lsp"         ("DICTSEARCH" 't_dictsearch  250) )
    ("ST" "Benches\\dictremove.lsp"         ("DICTREMOVE" 't_dictremove 1000) )
    ("ST" "Benches\\dictionary.lsp"         ("DICTIONARY" 't_dictionary  200) )
    ("ST" "Benches\\distance.lsp"           ("DISTANCE"   't_distance    750) )
    ("ST" "Benches\\distof.lsp"             ("DISTOF"     't_distof      400) )
    ("ST" "Benches\\entdel.lsp"             ("ENTDEL"     't_entdel      150) )
    ("ST" "Benches\\entget.lsp"             ("ENTGET"     't_entget      250) )
    ("ST" "Benches\\entlast.lsp"            ("ENTLAST"    't_entlast     750) )
    ("ST" "Benches\\entnext.lsp"            ("ENTNEXT"    't_entnext     500) )
    ("ST" "Benches\\entmake.lsp"            ("ENTMAKE"    't_entmake     5000) )
    ("ST" "Benches\\entmakex.lsp"           ("ENTMAKEX"   't_entmakex    5000) )
    ("ST" "Benches\\entmod.lsp"             ("ENTMOD"     't_entmod      150) )
    ("ST" "Benches\\entupd.lsp"             ("ENTUPD"     't_entupd      150) )
    ("ST" "Benches\\eq.lsp"                 ("EQ"         't_eq          300) )
    ("ST" "Benches\\equal.lsp"              ("EQUAL"      't_equal       150) )
    ("ST" "Benches\\eval.lsp"               ("EVAL"       't_eval        350) )
    ("ST" "Benches\\exp.lsp"                ("EXP"        't_exp         750) )
    ("ST" "Benches\\expt.lsp"               ("EXPT"       't_expt        500) )

    ("ST" "Benches\\foreach.lsp"            ("FOREACH"    't_foreach    1000) )
    ("ST" "Benches\\findfile.lsp"           ("FINDFILE"   't_findfile     30) )
    ("ST" "Benches\\fix.lsp"                ("FIX"        't_fix        1000) )
    ("ST" "Benches\\float.lsp"              ("FLOAT"      't_float      1000) )
    ("ST" "Benches\\function.lsp"           ("FUNCTION"   't_function   1000) )
    ("ST" "Benches\\gcd.lsp"                ("GCD"        't_gcd        1000) )
    ("ST" "Benches\\getcname.lsp"           ("GETCNAME"   't_getcname    200) )
    ("ST" "Benches\\getvar.lsp"             ("GETVAR"     't_getvar      400) )
    ("ST" "Benches\\getenv.lsp"             ("GETENV"     't_getenv      150) )
    ("ST" "Benches\\getcfg.lsp"             ("GETCFG"     't_getcfg      400) )
    ("ST" "Benches\\grdraw.lsp"             ("GRDRAW"     't_grdraw      300) )
    ("ST" "Benches\\grvecs.lsp"             ("GRVECS"     't_grvecs      200) )
    ("ST" "Benches\\handent.lsp"            ("HANDENT"    't_handent    1000) )
    ("ST" "Benches\\inters.lsp"             ("INTERS"     't_inters      300) )
    ("ST" "Benches\\if-then.lsp"            ("IF-THEN"       't_if_then      1500) )
    ("ST" "Benches\\if-then-else.lsp"       ("IF-THEN-ELSE"  't_if_then_else 1500) )

    ("ST" "Benches\\flt-muldivaddsub.lsp"   ("FLT MUL"    't_mul        1000)
                                            ("FLT DIV"    't_div        2000)
                                            ("FLT ADD"    't_add        2000)
                                            ("FLT SUB"    't_sub        2000)
                                            ("FLT ADD 1"  't_add1       2000)
                                            ("FLT SUB 1"  't_sub1       2000)
                                            ("FLT MUL 2"  't_mul2       2000)
                                            ("FLT DIV 2"  't_div2       2000)
                                            ("FLT ADD 2"  't_add2       2000)
                                            ("FLT SUB 2"  't_sub2       2000)
    )

    ("ST" "Benches\\int-muldivaddsub.lsp"   ("INT MUL"    't_mul        2000)
                                            ("INT DIV"    't_div        2000)
                                            ("INT ADD"    't_add        2000)
                                            ("INT SUB"    't_sub        2000)
                                            ("INT ADD 1"  't_add1       2000)
                                            ("INT SUB 1"  't_sub1       2000)
                                            ("INT MUL 2"  't_mul2       2000)
                                            ("INT DIV 2"  't_div2       2000)
                                            ("INT ADD 2"  't_add2       2000)
                                            ("INT SUB 2"  't_sub2       2000)
    )

    ("ST" "Benches\\itoa.lsp"               ("ITOA"       't_itoa       1000) )
    ("ST" "Benches\\lambda.lsp"             ("LAMBDA"     't_lambda     2000) )
    ("ST" "Benches\\last.lsp"               ("LAST"       't_last        300) )
    ("ST" "Benches\\layoutlist.lsp"         ("LAYOUTLIST" 't_layoutlist 2500) )
    ("ST" "Benches\\length.lsp"             ("LENGTH"     't_length      150) )
    ("ST" "Benches\\list.lsp"               ("LIST"       't_list       1000) )
    ("ST" "Benches\\listp.lsp"              ("LISTP"      't_listp      1500) )
    ("ST" "Benches\\load.lsp"               ("LOAD  Big"  't_load_big      4) ("LOAD Small"  't_load_small 150) )
    ("ST" "Benches\\log.lsp"                ("LOG"        't_log        1000) )
    ("ST" "Benches\\logand.lsp"             ("LOGAND"     't_logand      750) )
    ("ST" "Benches\\logior.lsp"             ("LOGIOR"     't_logior      750) )
    ("ST" "Benches\\lsh.lsp"                ("LSH"        't_lsh         750) )
    ("ST" "Benches\\mapcar.lsp"             ("MAPCAR"     't_mapcar     1000) )
    ("ST" "Benches\\member.lsp"             ("MEMBER 1"   't_member_1    750) ("MEMBER 2" 't_member_2 750) )
    ("ST" "Benches\\min.lsp"                ("MIN"        't_min         200) )
    ("ST" "Benches\\max.lsp"                ("MAX"        't_max         200) )
    ("ST" "Benches\\minusp.lsp"             ("MINUSP"     't_minusp     1000) )
    ("ST" "Benches\\namedobjdict.lsp"       ("NAMEDOBJDICT"  't_namedobjdict  1000) )
    ("ST" "Benches\\numberp.lsp"            ("NUMBERP"    't_numberp    1000) )
    ("ST" "Benches\\nth.lsp"                ("NTH"        't_nth        1500)
                                            ("NTH-0"      't_nth_0      1500)
                                            ("NTH-1"      't_nth_1      1500)
                                            ("NTH-2"      't_nth_2      1500)
    )
    ("ST" "Benches\\openclose.lsp"          ("OPEN/CLOSE" 't_openclose   150) )
    ("ST" "Benches\\polar.lsp"              ("POLAR"      't_polar       500) )
    ("ST" "Benches\\print.lsp"              ("PRINT"      't_print        30) )
    ("ST" "Benches\\prin1.lsp"              ("PRIN1"      't_prin1        40) )
    ("ST" "Benches\\princ.lsp"              ("PRINC"      't_princ        40) )
    ("ST" "Benches\\prompt.lsp"             ("PROMPT"     't_prompt       40) )
    ("ST" "Benches\\progn.lsp"              ("PROGN"      't_progn       750) )
    ("ST" "Benches\\quote.lsp"              ("QUOTE"      't_quote      1000) )
    ("ST" "Benches\\read.lsp"               ("READ"       't_read        200) )
    ("ST" "Benches\\readwrite-char.lsp"     ("WRITE-CHAR" 't_writechar   300) ("READ-CHAR" 't_readchar 300))
;;  ("ST" "Benches\\readwrite-line.lsp"     ("WRITE-LINE" 't_writeline   500) ("READ-LINE" 't_readline 500))
    ("ST" "Benches\\write-char-screen.lsp"  ("WRITE-CHAR-SCREEN" 't_writechar_screen  100) )
    ("ST" "Benches\\redraw.lsp"             ("REDRAW"     't_redraw      500) )
    ("ST" "Benches\\repeat.lsp"             ("REPEAT"     't_repeat     1000) )
    ("ST" "Benches\\reverse.lsp"            ("REVERSE"    't_reverse     150) )
    ("ST" "Benches\\rtos.lsp"               ("RTOS"       't_rtos        300) )
    ("ST" "Benches\\rem.lsp"                ("REM"        't_rem        1000) )
    ("ST" "Benches\\set.lsp"                ("SET"        't_set         750) )
    ("ST" "Benches\\setq.lsp"               ("SETQ"       't_setq        750) )
    ("ST" "Benches\\setvar.lsp"             ("SETVAR"     't_setvar      100) )
    ("ST" "Benches\\setenv.lsp"             ("SETENV"     't_setenv      150) )
    ("ST" "Benches\\setcfg.lsp"             ("SETCFG"     't_setcfg      400) )
    ("ST" "Benches\\sin.lsp"                ("SIN"        't_sin        1000) )
    ("ST" "Benches\\snvalid.lsp"            ("SNVALID"    't_snvalid     750) )
    ("ST" "Benches\\ssadd.lsp"              ("SSADD"      't_ssadd       100) )
    ("ST" "Benches\\ssdel.lsp"              ("SSDEL"      't_ssdel       500) )
    ("ST" "Benches\\ssget.lsp"              ("SSGET"      't_ssget      2000) )
    ("ST" "Benches\\sslength.lsp"           ("SSLENGTH"   't_sslength   1000) )
    ("ST" "Benches\\ssmemb.lsp"             ("SSMEMB"     't_ssmemb      750) )
    ("ST" "Benches\\ssname.lsp"             ("SSNAME"     't_ssname      750) )
    ("ST" "Benches\\ssnamex.lsp"            ("SSNAMEX"    't_ssnamex     100) )
    ("ST" "Benches\\sqrt.lsp"               ("SQRT"       't_sqrt       1000) )
    ("ST" "Benches\\strcase.lsp"            ("STRCASE"    't_strcase     400) )
    ("ST" "Benches\\xstrcase.lsp"           ("XSTRCASE"   't_xstrcase    400) )
    ("ST" "Benches\\strcat.lsp"             ("STRCAT"     't_strcat      400) )
    ("ST" "Benches\\strlen.lsp"             ("STRLEN"     't_strlen      500) )
    ("ST" "Benches\\substr.lsp"             ("SUBSTR"     't_substr      400) )
    ("ST" "Benches\\subst.lsp"              ("SUBST"      't_subst      1000) )
    ("ST" "Benches\\textbox.lsp"            ("TEXTBOX"    't_textbox     200) )
    ("ST" "Benches\\tblsearch.lsp"          ("TBLSEARCH"  't_tblsearch   150) )
    ("ST" "Benches\\tblnext.lsp"            ("TBLNEXT"    't_tblnext     150) )
    ("ST" "Benches\\tblobjname.lsp"         ("TBLOBJNAME" 't_tblobjname  500) )
    ("ST" "Benches\\trans.lsp"              ("TRANS"      't_trans       500) )
    ("ST" "Benches\\wcmatch.lsp"            ("WCMATCH"    't_wcmatch     600) )
    ("ST" "Benches\\while.lsp"              ("WHILE"      't_while      2000) )
    ("ST" "Benches\\xdroom.lsp"             ("XDROOM"     't_xdroom      500) )
    ("ST" "Benches\\xdsize.lsp"             ("XDSIZE"     't_xdsize      500) )
    ("ST" "Benches\\zerop.lsp"              ("ZEROP"      't_zerop      1000) )

    ("ST" "Benches\\ispropertyreadonly.lsp" ("IsPropertyReadonly"  't_ispropertyreadonly  300) )
    ("ST" "Benches\\getpropertyvalue.lsp"   ("GetPropertyValue"    't_getpropertyvalue    300) )
    ("ST" "Benches\\setpropertyvalue.lsp"   ("SetPropertyValue"    't_setpropertyvalue    200) )

    ;;============== VL Functions ==============
    ("VL" "Benches\\Vl\\vl-bbset.lsp"           ("VL-BB-SET"            't_vlbbset            700) )
    ("VL" "Benches\\Vl\\vl-bbref.lsp"           ("VL-BB-REF"            't_vlbbref            700) )
    ("VL" "Benches\\Vl\\vl-cmdf.lsp"            ("VL-CMDF"              't_vlcmdf             100) )
    ("VL" "Benches\\Vl\\vl-consp.lsp"           ("VL-CONSP"             't_vlconsp           1000) )
    ("VL" "Benches\\Vl\\vl-directory-files.lsp" ("VL-DIRECTORY-FILES"   't_vldirectoryfiles    20) )
    ("VL" "Benches\\Vl\\vl-doc-ref.lsp"         ("VL-DOC-REF"           't_vldocref           200) )
    ("VL" "Benches\\Vl\\vl-doc-set.lsp"         ("VL-DOC-SET"           't_vldocset           200) )
    ("VL" "Benches\\Vl\\vl-every.lsp"           ("VL-EVERY"             't_vlevery            600) )
    ("VL" "Benches\\Vl\\vl-filename-xxx.lsp"    ("VL-FILENAME-XXX"      't_vlfilename         400) )
    ("VL" "Benches\\Vl\\vl-filename-mktemp.lsp" ("VL-FILENAME-MKTEMP"   't_vlfilenamemketmp   100) )
    ("VL" "Benches\\Vl\\vl-file-rename.lsp"     ("VL-FILE-RENAME"       't_vlfilerename        50) )
    ("VL" "Benches\\Vl\\vl-file-copy.lsp"       ("VL-FILE-COPY"         't_vlfilecopy         300) )
    ("VL" "Benches\\Vl\\vl-file-delete.lsp"     ("VL-FILE-DELETE"       't_vlfiledelete       300) )
    ("VL" "Benches\\Vl\\vl-file-directory-p.lsp"("VL-FILE-DIRECTORY-P"  't_vlfiledirectoryp   300) )
    ("VL" "Benches\\Vl\\vl-file-size.lsp"       ("VL-FILE-SIZE"         't_vlfilesize         100) )
    ("VL" "Benches\\Vl\\vl-file-systime.lsp"    ("VL-FILE-SYSTIME"      't_vlfilesystime      100) )
    ("VL" "Benches\\Vl\\vl-list2string.lsp"     ("VL-LIST->STRING"      't_vllist2string      750) )
    ("VL" "Benches\\Vl\\vl-list-length.lsp"     ("VL-LIST-LENGTH"       't_vllistlength       100) )
    ("VL" "Benches\\Vl\\vl-list#star.lsp"       ("VL-LIST*"             't_vllist*           1000) )
    ("VL" "Benches\\Vl\\vl-member-if.lsp"       ("VL-MEMBER-IF"         't_vlmemberif         800) )
    ("VL" "Benches\\Vl\\vl-member-if-not.lsp"   ("VL-MEMBER-IF-NOT"     't_vlmemberifnot      800) )
    ("VL" "Benches\\Vl\\vl-position.lsp"        ("VL-POSITION"          't_vlposition        1000) )
    ("VL" "Benches\\Vl\\vl-prin1-to-string.lsp" ("VL-PRIN1-TO-STRING"   't_vlprin1tostring    300) )
    ("VL" "Benches\\Vl\\vl-princ-to-string.lsp" ("VL-PRINC-TO-STRING"   't_vlprinctostring    300) )
    ("VL" "Benches\\Vl\\vl-registry.lsp"        ("VL-REGISTRY"          't_vlregistry          25) )
    ("VL" "Benches\\Vl\\vl-remove.lsp"          ("VL-REMOVE"            't_vlremove          1000) )
    ("VL" "Benches\\Vl\\vl-remove-if.lsp"       ("VL-REMOVE-IF"         't_vlremoveif         750) )
    ("VL" "Benches\\Vl\\vl-remove-if-not.lsp"   ("VL-REMOVE-IF-NOT"     't_vlremoveifnot      750) )
    ("VL" "Benches\\Vl\\vl-some.lsp"            ("VL-SOME"              't_vlsome             750) )
    ("VL" "Benches\\Vl\\vl-sort.lsp"            ("VL-SORT"              't_vlsort             500) )
    ("VL" "Benches\\Vl\\vl-sort-i.lsp"          ("VL-SORT-I"            't_vlsorti            150) )
    ("VL" "Benches\\Vl\\vl-string-elt.lsp"      ("VL-STRING-ELT"        't_vlstringelt       1500) )
    ("VL" "Benches\\Vl\\vl-string2list.lsp"     ("VL-STRING->LIST"      't_vlstring2list      800) )
    ("VL" "Benches\\Vl\\vl-stringltrim.lsp"     ("VL-STRING-LEFT-TRIM"  't_vlstringltrim      750) )
    ("VL" "Benches\\Vl\\vl-stringrtrim.lsp"     ("VL-STRING-RIGHT-TRIM" 't_vlstringrtrim      750) )
    ("VL" "Benches\\Vl\\vl-stringtrim.lsp"      ("VL-STRING-TRIM"       't_vlstringtrim       750) )
    ("VL" "Benches\\Vl\\vl-stringmismatch.lsp"  ("VL-STRING-MISMATCH"   't_vlstringmismatch   800) )
    ("VL" "Benches\\Vl\\vl-stringposition.lsp"  ("VL-STRING-POSITION"   't_vlstringposition   800) )
    ("VL" "Benches\\Vl\\vl-stringsearch.lsp"    ("VL-STRING-SEARCH"     't_vlstringsearch     800) )
    ("VL" "Benches\\Vl\\vl-stringsubst.lsp"     ("VL-STRING-SUBST"      't_vlstringsubst      700) )
    ("VL" "Benches\\Vl\\vl-stringtranslate.lsp" ("VL-STRING-TRANSLATE"  't_vlstringtranslate  500) )
    ("VL" "Benches\\Vl\\vl-symbol-name.lsp"     ("VL-SYMBOL-NAME"       't_vlsymbolname      1000) )
    ("VL" "Benches\\Vl\\vl-symbol-value.lsp"    ("VL-SYMBOL-VALUE"      't_vlsymbolvalue     1000) )
    ("VL" "Benches\\Vl\\vl-symbol-p.lsp"        ("VL-SYMBOLP"           't_vlsymbolp         1000) )

    ;;============= VLAX Functions =============
    ("VLAX" "Benches\\Vlax\\vlax-get-acad-object.lsp"        ("VLAX-GET-ACAD-OBJECT"        't_vlax_getacadobject           500) )
    ("VLAX" "Benches\\Vlax\\vlax-product-key.lsp"            ("VLAX-PRODUCT-KEY"            't_vlax_productkey              500) )
    ("VLAX" "Benches\\Vlax\\vlax-for.lsp"                    ("VLAX-FOR"                    't_vlax-for                     200) )
    ("VLAX" "Benches\\Vlax\\vlax-get-property.lsp"           ("VLAX-GET-PROPERTY"           't_vlax-get-property             50) )
    ("VLAX" "Benches\\Vlax\\vlax-get.lsp"                    ("VLAX-GET"                    't_vlax-get                      50) )
    ("VLAX" "Benches\\Vlax\\vlax-put-property.lsp"           ("VLAX-PUT-PROPERTY"           't_vlax-put-property             50) )
    ("VLAX" "Benches\\Vlax\\vlax-put.lsp"                    ("VLAX-PUT"                    't_vlax-put                      50) )
    ("VLAX" "Benches\\Vlax\\vlax-ename-2-vla-object.lsp"     ("VLAX-ENAME->VLA-OBJECT"      't_vlax-ename->vla-object       200) )
    ("VLAX" "Benches\\Vlax\\vlax-vla-object-2-ename.lsp"     ("VLAX-VLA-OBJECT->ENAME"      't_vlax-vla-object->ename       300) )
    ("VLAX" "Benches\\Vlax\\vlax-3d-point.lsp"               ("VLAX-3D-POINT"               't_vlax_3dpoint                 100) )
    ("VLAX" "Benches\\Vlax\\vlax-make-variant.lsp"           ("VLAX-MAKE-VARIANT"           't_vlax-make-variant            300) )
    ("VLAX" "Benches\\Vlax\\variant.lsp"                     (          "VARIANT"           't_variant                      300) )
    ("VLAX" "Benches\\Vlax\\vlax-variant-type.lsp"           ("VLAX-VARIANT-TYPE"           't_vlax-variant-type            500) )
    ("VLAX" "Benches\\Vlax\\variant-type.lsp"                (     "VARIANT-TYPE"           't_variant-type                 500) )
    ("VLAX" "Benches\\Vlax\\vlax-variant-value.lsp"          ("VLAX-VARIANT-VALUE"          't_vlax-variant-value           400) )
    ("VLAX" "Benches\\Vlax\\variant-value.lsp"               (     "VARIANT-VALUE"          't_variant-value                400) )
    ("VLAX" "Benches\\Vlax\\vlax-variant-change-type.lsp"    ("VLAX-VARIANT-CHANGE-TYPE"    't_vlax-variant-change-type     500) )
    ("VLAX" "Benches\\Vlax\\vlax-make-safearray.lsp"         ("VLAX-MAKE-SAFEARRAY"         't_vlax-make-safearray          200) )
    ("VLAX" "Benches\\Vlax\\safearray.lsp"                   (          "SAFEARRAY"         't_safearray                    200) )
    ("VLAX" "Benches\\Vlax\\vlax-object-released-p.lsp"      ("VLAX-OBJECT-RELEASED-P"      't_vlax-object-released-p      1000) )
    ("VLAX" "Benches\\Vlax\\vlax-safearray-fill.lsp"         ("VLAX-SAFEARRAY-FILL"         't_vlax-safearray-fill          100) )
    ("VLAX" "Benches\\Vlax\\vlax-safearray-get-dim.lsp"      ("VLAX-SAFEARRAY-GET-DIM"      't_vlax-safearray-get-dim       750) )
    ("VLAX" "Benches\\Vlax\\safearray-get-dim.lsp"           (     "SAFEARRAY-GET-DIM"      't_safearray-get-dim            750) )
    ("VLAX" "Benches\\Vlax\\vlax-safearray-get-l-bound.lsp"  ("VLAX-SAFEARRAY-GET-L-BOUND"  't_vlax-safearray-get-l-bound   750) )
    ("VLAX" "Benches\\Vlax\\safearray-get-l-bound.lsp"       (     "SAFEARRAY-GET-L-BOUND"  't_safearray-get-l-bound        750) )
    ("VLAX" "Benches\\Vlax\\vlax-safearray-get-u-bound.lsp"  ("VLAX-SAFEARRAY-GET-U-BOUND"  't_vlax-safearray-get-u-bound   750) )
    ("VLAX" "Benches\\Vlax\\safearray-get-u-bound.lsp"       (     "SAFEARRAY-GET-U-BOUND"  't_safearray-get-u-bound        750) )
    ("VLAX" "Benches\\Vlax\\vlax-safearray-type.lsp"         ("VLAX-SAFEARRAY-TYPE"         't_vlax-safearray-type          600) )
    ("VLAX" "Benches\\Vlax\\safearray-type.lsp"              (     "SAFEARRAY-TYPE"         't_safearray-type               600) )
    ("VLAX" "Benches\\Vlax\\vlax-safearray-get-element.lsp"  ("VLAX-SAFEARRAY-GET-ELEMENT"  't_vlax-safearray-get-element   300) )
    ("VLAX" "Benches\\Vlax\\safearray-get-element.lsp"       (     "SAFEARRAY-GET-ELEMENT"  't_safearray-get-element        300) )
    ("VLAX" "Benches\\Vlax\\vlax-safearray-put-element.lsp"  ("VLAX-SAFEARRAY-PUT-ELEMENT"  't_vlax-safearray-put-element   300) )
    ("VLAX" "Benches\\Vlax\\safearray-put-element.lsp"       (     "SAFEARRAY-PUT-ELEMENT"  't_safearray-put-element        300) )
    ("VLAX" "Benches\\Vlax\\vlax-safearray-2-list.lsp"       ("VLAX-SAFEARRAY->LIST"        't_vlax-safearray->list         150) )
    ("VLAX" "Benches\\Vlax\\safearray-value.lsp"             (     "SAFEARRAY-VALUE"        't_safearray-value              200) )
    ("VLAX" "Benches\\Vlax\\vlax-create-object.lsp"          ("VLAX-CREATE-OBJECT"          't_vlax-create-object           300) )
    ("VLAX" "Benches\\Vlax\\vlax-get-object.lsp"             ("VLAX-GET-OBJECT"             't_vlax-get-object              100) )
    ("VLAX" "Benches\\Vlax\\vlax-get-or-create-object.lsp"   ("VLAX-GET-OR-CREATE-OBJECT"   't_vlax-get-or-create-object    200) )
    ("VLAX" "Benches\\Vlax\\vlax-import-type-library.lsp"    ("VLAX-IMPORT-TYPE-LIBRARY"    't_vlax-import-type-library       3) )
    ("VLAX" "Benches\\Vlax\\vlax-erased-p.lsp"               ("VLAX-ERASED-P"               't_vlax-erased-p                200) )
    ("VLAX" "Benches\\Vlax\\vlax-read-enabled-p.lsp"         ("VLAX-READ-ENABLED-P"         't_vlax-read-enabled-p          300) )
    ("VLAX" "Benches\\Vlax\\vlax-write-enabled-p.lsp"        ("VLAX-WRITE-ENABLED-P"        't_vlax-write-enabled-p         300) )
    ("VLAX" "Benches\\Vlax\\vlax-method-applicable-p.lsp"    ("VLAX-METHOD-APPLICABLE-P"    't_vlax-method-applicable-p      50) )
    ("VLAX" "Benches\\Vlax\\vlax-property-available-p.lsp"   ("VLAX-PROPERTY-AVAILABLE-P"   't_vlax-property-available-p     40) )
    ("VLAX" "Benches\\Vlax\\vlax-typeinfo-available-p.lsp"   ("VLAX-TYPEINFO-AVAILABLE-P"   't_vlax-typeinfo-available-p   1000) )
    ("VLAX" "Benches\\Vlax\\vlax-map-collection.lsp"         ("VLAX-MAP-COLLECTION"         't_vlax-map-collection          250) )
    ("VLAX" "Benches\\Vlax\\vlax-invoke-method.lsp"          ("VLAX-INVOKE-METHOD"          't_vlax-invoke-method           100) )
    ("VLAX" "Benches\\Vlax\\vlax-invoke.lsp"                 ("VLAX-INVOKE"                 't_vlax-invoke                  100) )
    ("VLAX" "Benches\\Vlax\\vlax-ldata-list.lsp"             ("VLAX-LDATA-LIST"             't_vlax-ldata-list              200) )
    ("VLAX" "Benches\\Vlax\\vlax-ldata-test.lsp"             ("VLAX-LDATA-TEST"             't_vlax-ldata-test              200) )
    ("VLAX" "Benches\\Vlax\\vlax-ldata-put.lsp"              ("VLAX-LDATA-PUT"              't_vlax-ldata-put               125) )
    ("VLAX" "Benches\\Vlax\\vlax-ldata-get.lsp"              ("VLAX-LDATA-GET"              't_vlax-ldata-get               125) )
    ("VLAX" "Benches\\Vlax\\vlax-ldata-delete.lsp"           ("VLAX-LDATA-DELETE"           't_vlax-ldata-delete            200) )
    ;----- Curve Functions -----
    ("VLAX" "Benches\\Vlax\\vlax-curve-get-area.lsp"         ("VLAX-CURVE-GET-AREA"         't_vlax-curve-get-area          300) )
    ("VLAX" "Benches\\Vlax\\vlax-curve-getdistatparam.lsp"   ("VLAX-CURVE-GET-DISTATPARAM"  't_vlax-curve-getdistatparam    300) )
    ("VLAX" "Benches\\Vlax\\vlax-curve-getdistatpoint.lsp"   ("VLAX-CURVE-GET-DISTATPOINT"  't_vlax-curve-getdistatpoint    300) )
    ("VLAX" "Benches\\Vlax\\vlax-curve-getstartparam.lsp"    ("VLAX-CURVE-GET-STARTPARAM"   't_vlax-curve-getstartparam     300) )
    ("VLAX" "Benches\\Vlax\\vlax-curve-getendparam.lsp"      ("VLAX-CURVE-GET-ENDPARAM"     't_vlax-curve-getendparam       300) )
    ("VLAX" "Benches\\Vlax\\vlax-curve-getstartpoint.lsp"    ("VLAX-CURVE-GET-STARTPOINT"   't_vlax-curve-getstartpoint     150) )
    ("VLAX" "Benches\\Vlax\\vlax-curve-getendpoint.lsp"      ("VLAX-CURVE-GET-ENDPOINT"     't_vlax-curve-getendpoint       150) )
    ("VLAX" "Benches\\Vlax\\vlax-curve-getpointatdist.lsp"   ("VLAX-CURVE-GET-POINTATDIST"  't_vlax-curve-getpointatdist    150) )
    ("VLAX" "Benches\\Vlax\\vlax-curve-getpointatparam.lsp"  ("VLAX-CURVE-GET-POINTATPARAM" 't_vlax-curve-getpointatparam   150) )
    ("VLAX" "Benches\\Vlax\\vlax-curve-getparamatdist.lsp"   ("VLAX-CURVE-GET-PARAMATDIST"  't_vlax-curve-getparamatdist    300) )
    ("VLAX" "Benches\\Vlax\\vlax-curve-getparamatpoint.lsp"  ("VLAX-CURVE-GET-PARAMATPOINT" 't_vlax-curve-getparamatpoint   300) )
    ("VLAX" "Benches\\Vlax\\vlax-curve-isclosed.lsp"         ("VLAX-CURVE-GET-ISCLOSED"     't_vlax-curve-isclosed          300) )
    ("VLAX" "Benches\\Vlax\\vlax-curve-isperiodic.lsp"       ("VLAX-CURVE-GET-ISPERIODIC"   't_vlax-curve-isperiodic        300) )
    ("VLAX" "Benches\\Vlax\\vlax-curve-isplanar.lsp"         ("VLAX-CURVE-GET-ISPLANAR"     't_vlax-curve-isplanar          300) )

    ;;============= VLA Functions ==============
    ("VLA" "Benches\\Vla\\vla-get-activedocument.lsp"        ("VLA-GET-ACTIVEDOCUMENT"      't_vla_getactivedocument        250) )
    ("VLA" "Benches\\Vla\\vla-get-activespace.lsp"           ("VLA-GET-ACTIVESPACE"         't_vla_getactivespace           250) )
    ("VLA" "Benches\\Vla\\vla-get-activelayout.lsp"          ("VLA-GET-ACTIVELAYOUT"        't_vla_getactivelayout          250) )
    ("VLA" "Benches\\Vla\\vla-get-activelayer.lsp"           ("VLA-GET-ACTIVELAYER"         't_vla_getactivelayer           250) )
    ("VLA" "Benches\\Vla\\vla-get-activelinetype.lsp"        ("VLA-GET-ACTIVELINETYPE"      't_vla_getactivelinetype        250) )
    ("VLA" "Benches\\Vla\\vla-get-activetextstyle.lsp"       ("VLA-GET-ACTIVETEXTSTYLE"     't_vla_getactivetextstyle       250) )
    ("VLA" "Benches\\Vla\\vla-get-activeviewport.lsp"        ("VLA-GET-ACTIVEVIEWPORT"      't_vla_getactiveviewport        200) )
    ("VLA" "Benches\\Vla\\vla-get-activedimstyle.lsp"        ("VLA-GET-ACTIVEDIMSTYLE"      't_vla_getactivedimstyle        200) )
    ("VLA" "Benches\\Vla\\vla-get-activeucs.lsp"             ("VLA-GET-ACTIVEUCS"           't_vla_getactiveucs             200) )
    ("VLA" "Benches\\Vla\\vla-put-activelayer.lsp"           ("VLA-PUT-ACTIVELAYER"         't_vla_putactivelayer            75) )
    ("VLA" "Benches\\Vla\\vla-put-activelinetype.lsp"        ("VLA-PUT-ACTIVELINETYPE"      't_vla_putactivelinetype        200) )
    ("VLA" "Benches\\Vla\\vla-put-activetextstyle.lsp"       ("VLA-PUT-ACTIVETEXTSTYLE"     't_vla_putactivetextstyle       200) )
    ("VLA" "Benches\\Vla\\vla-put-activedimstyle.lsp"        ("VLA-PUT-ACTIVEDIMSTYLE"      't_vla_putactivedimstyle        200) )

    ("VLA" "Benches\\Vla\\vla-get-layer.lsp"                 ("VLA-GET-LAYER"               't_vla_getlayer                 300) )
    ("VLA" "Benches\\Vla\\vla-get-lineweight.lsp"            ("VLA-GET-LINEWEIGHT"          't_vla_getlineweight            300) )
    ("VLA" "Benches\\Vla\\vla-put-layer.lsp"                 ("VLA-PUT-LAYER"               't_vla_putlayer                 300) )
    ("VLA" "Benches\\Vla\\vla-put-lineweight.lsp"            ("VLA-PUT-LINEWEIGHT"          't_vla_putlineweight            300) )

    ("VLA" "Benches\\Vla\\vla-collection2list.lsp"           ("VLA-COLLECTION->LIST"        't_vla_collection2list          300) )
    ("VLA" "Benches\\Vla\\vla-getboundingbox.lsp"            ("VLA-GETBOUNDINGBOX"          't_vla_getboundingbox           300) )

    ;;============ VLA Fast Functions ==========
    ("VLA-Fast" "Benches\\Vla-FastCom\\vlaFast-get-layer.lsp"        ("VLA-GET-LAYER (fast COM)"                 't_vla_fastcom_getlayer                  300) )
    ("VLA-Fast" "Benches\\Vla-FastCom\\vlaxFast-get-layer.lsp"       ("VLAX-GET-PROPERTY Layer (fast COM)"       't_vlax_fastcom_getproperty_layer        300) )
    ("VLA-Fast" "Benches\\Vla-FastCom\\vlaFast-get-color.lsp"        ("VLA-GET-COLOR (fast COM)"                 't_vla_fastcom_getcolor                  300) )
    ("VLA-Fast" "Benches\\Vla-FastCom\\vlaxFast-get-color.lsp"       ("VLAX-GET-PROPERTY Color (fast COM)"       't_vlax_fastcom_getproperty_color        300) )
    ("VLA-Fast" "Benches\\Vla-FastCom\\vlaFast-get-lineweight.lsp"   ("VLA-GET-LINEWEIGHT (fast COM)"            't_vla_fastcom_getlineweight             300) )
    ("VLA-Fast" "Benches\\Vla-FastCom\\vlaxFast-get-lineweight.lsp"  ("VLAX-GET-PROPERTY Lineweight (fast COM)"  't_vlax_fastcom_getproperty_lineweight   300) )
    ("VLA-Fast" "Benches\\Vla-FastCom\\vlaFast-get-linetype.lsp"     ("VLA-GET-LINETYPE (fast COM)"              't_vla_fastcom_getlinetype               300) )
    ("VLA-Fast" "Benches\\Vla-FastCom\\vlaxFast-get-linetype.lsp"    ("VLAX-GET-PROPERTY LineType (fast COM)"    't_vlax_fastcom_getproperty_linetype     300) )
    ("VLA-Fast" "Benches\\Vla-FastCom\\vlaFast-get-documents.lsp"    ("VLA-GET-DOCUMENTS (fast COM)"             't_vla_fastcom_getdocuments              300) )
    ("VLA-Fast" "Benches\\Vla-FastCom\\vlaxFast-get-documents.lsp"   ("VLAX-GET-PROPERTY Documents (fast COM)"   't_vlax_fastcom_getproperty_documents    300) )

    ("VLA-Fast" "Benches\\Vla-FastCom\\vlaFast-get-activelinetype.lsp"  ("VLA-GET-ACTIVELINETYPE (fast COM)"            't_vla_fastcom_getactivelinetype            300) )
    ("VLA-Fast" "Benches\\Vla-FastCom\\vlaxFast-get-activelinetype.lsp" ("VLAX-GET-PROPERTY ActiveLinetype (fast COM)"  't_vlax_fastcom_getproperty_activelinetype  300) )

    ("VLA-Fast" "Benches\\Vla-FastCom\\vlaFast-StartEndUndoMark.lsp"    ("VLA-StartEndUndoMark (fast COM)"   't_vla_fastcom_startendundomark    250) )
    ("VLA-Fast" "Benches\\Vla-FastCom\\vlaxFast-StartEndUndoMark.lsp"   ("VLAX-StartEndUndoMark (fast COM)"  't_vlax_fastcom_startendundomark   250) )
    ("VLA-Fast" "Benches\\Vla-FastCom\\vlaFast-collection2list.lsp"     ("VLA-COLLECTION->LIST (fast COM)"   't_vla_fastcom_collection2list     300) )

    ("VLA-Fast" "Benches\\Vla-FastCom\\vlaFast-addline.lsp"          ("VLA-ADDLINE (fast COM)"                   't_vla_fastcom_addline                   100) )
    ("VLA-Fast" "Benches\\Vla-FastCom\\vlaFast-add3dpoly.lsp"        ("VLA-ADD3DPOLY (fast COM)"                 't_vla_fastcom_add3dpoly                  50) )


    ;;============== VLE Functions ==============
    ("VLE" "Benches\\Vle\\vle-file2list.lsp"       ("VLE-FILE->LIST"   't_vle_file->list     30) )

    ("VLE" "Benches\\Vle\\vle-nth0.lsp"            ("VLE-NTH0"         't_vle_nth0         1500) )
    ("VLE" "Benches\\Vle\\vle-nth5.lsp"            ("VLE-NTH5"         't_vle_nth5         1500) )
    ("VLE" "Benches\\Vle\\vle-nth9.lsp"            ("VLE-NTH9"         't_vle_nth9         1500) )
    ("VLE" "Benches\\Vle\\vle-cdrassoc.lsp"        ("VLE-CDRASSOC"     't_vle_cdrassoc      750) )
    ("VLE" "Benches\\Vle\\vle-set-cdrassoc.lsp"    ("VLE-SET-CDRASSOC" 't_vle_set_cdrassoc  500) )
    ("VLE" "Benches\\Vle\\vle-cadrassoc.lsp"       ("VLE-CADRASSOC"    't_vle_cadrassoc     750) )
    ("VLE" "Benches\\Vle\\vle-remove-first.lsp"    ("VLE-REMOVE-FIRST" 't_vle_remove_first  150) )
    ("VLE" "Benches\\Vle\\vle-remove-all.lsp"      ("VLE-REMOVE-ALL"   't_vle_remove_all    150) )
    ("VLE" "Benches\\Vle\\vle-remove-last.lsp"     ("VLE-REMOVE-LAST"  't_vle_remove_last   500) )
    ("VLE" "Benches\\Vle\\vle-remove-nth.lsp"      ("VLE-REMOVE-NTH"   't_vle_remove_nth    250) )
;;  ("VLE" "Benches\\Vle\\vle-massoc.lsp"          ("VLE-MASSOC"       't_vle_massoc        250) )
    ("VLE" "Benches\\Vle\\vle-member.lsp"          ("VLE-MEMBER"       't_vle_member        250) )
    ("VLE" "Benches\\Vle\\vle-search.lsp"          ("VLE-SEARCH"       't_vle_search        250) )
    ("VLE" "Benches\\Vle\\vle-sublist.lsp"         ("VLE-SUBLIST"      't_vle_sublist       250) )
    ("VLE" "Benches\\Vle\\vle-subst-nth.lsp"       ("VLE-SUBST-NTH"    't_vle_subst_nth     250) )
    ("VLE" "Benches\\Vle\\vle-put-nth.lsp"         ("VLE-PUT-NTH"      't_vle_put_nth       250) )
    ("VLE" "Benches\\Vle\\vle-list-split.lsp"      ("VLE-LIST-SPLIT"   't_vle_list_split    250) )
    ("VLE" "Benches\\Vle\\vle-list-union.lsp"      ("VLE-LIST-UNION"   't_vle_list_union    250) )
    ("VLE" "Benches\\Vle\\vle-list-intersect.lsp"  ("VLE-LIST-INTERSECT"  't_vle_list_intersect  250) )
    ("VLE" "Benches\\Vle\\vle-list-subtract.lsp"   ("VLE-LIST-SUBTRACT"   't_vle_list_subtract   250) )
    ("VLE" "Benches\\Vle\\vle-list-diff.lsp"       ("VLE-LIST-DIFF"    't_vle_list_diff     250) )

    ("VLE" "Benches\\Vle\\vle-displaypause.lsp"    ("VLE-DISPLAYPAUSE" 't_vle_displaypause 150) )
    ("VLE" "Benches\\Vle\\vle-transaction.lsp"     ("VLE-TRANSACTION"  't_vle_transaction  100) )

    ("VLE" "Benches\\Vle\\vle-collection2list.lsp" ("VLE-COLLECTION->LIST"   't_vle_collection2list  300) )
    ("VLE" "Benches\\Vle\\vle-selection2list.lsp"  ("VLE-SELECTIONSET->LIST" 't_vle_selection2list   300) )

    ("VLE" "Benches\\Vle\\vle-string-split.lsp"    ("VLE-STRING-SPLIT"       't_vle_string_split     150) )
    ("VLE" "Benches\\Vle\\vle-string-replace.lsp"  ("VLE-STRING-REPLACE"     't_vle_string_replace   150) )

    ("VLE" "Benches\\Vle\\vle-stringp.lsp"     ("VLE-STRINGP"     't_vle_stringp      800) )
    ("VLE" "Benches\\Vle\\vle-numberp.lsp"     ("VLE-NUMBERP"     't_vle_numberp      800) )
    ("VLE" "Benches\\Vle\\vle-realp.lsp"       ("VLE-REALP"       't_vle_realp        800) )
    ("VLE" "Benches\\Vle\\vle-integerp.lsp"    ("VLE-INTEGERP"    't_vle_integerp     800) )
    ("VLE" "Benches\\Vle\\vle-filep.lsp"       ("VLE-FILEP"       't_vle_filep        800) )
    ("VLE" "Benches\\Vle\\vle-enamep.lsp"      ("VLE-ENAMEP"      't_vle_enamep       800) )
    ("VLE" "Benches\\Vle\\vle-picksetp.lsp"    ("VLE-PICKSETP"    't_vle_picksetp     800) )
    ("VLE" "Benches\\Vle\\vle-variantp.lsp"    ("VLE-VARIANTP"    't_vle_variantp     800) )
    ("VLE" "Benches\\Vle\\vle-safearrayp.lsp"  ("VLE-SAFEARRAYP"  't_vle_safearrayp   800) )
    ("VLE" "Benches\\Vle\\vle-vlaobjectp.lsp"  ("VLE-VLAOBJECTP"  't_vle_vlaobjectp   800) )

    ("VLE" "Benches\\Vle\\vle-entget-0.lsp"    ("VLE-ENTGET dxf 0"    't_vle_entget_dxf0    300) )
    ("VLE" "Benches\\Vle\\vle-entget-6.lsp"    ("VLE-ENTGET dxf 6"    't_vle_entget_dxf6    300) )
    ("VLE" "Benches\\Vle\\vle-entget-7.lsp"    ("VLE-ENTGET dxf 7"    't_vle_entget_dxf7    300) )
    ("VLE" "Benches\\Vle\\vle-entget-8.lsp"    ("VLE-ENTGET dxf 8"    't_vle_entget_dxf8    300) )
    ("VLE" "Benches\\Vle\\vle-entget-10.lsp"   ("VLE-ENTGET dxf 10"   't_vle_entget_dxf10   300) )
    ("VLE" "Benches\\Vle\\vle-entget-11.lsp"   ("VLE-ENTGET dxf 11"   't_vle_entget_dxf11   300) )
    ("VLE" "Benches\\Vle\\vle-entget-38.lsp"   ("VLE-ENTGET dxf 38"   't_vle_entget_dxf38   300) )
    ("VLE" "Benches\\Vle\\vle-entget-39.lsp"   ("VLE-ENTGET dxf 39"   't_vle_entget_dxf39   300) )
    ("VLE" "Benches\\Vle\\vle-entget-48.lsp"   ("VLE-ENTGET dxf 48"   't_vle_entget_dxf48   300) )
    ("VLE" "Benches\\Vle\\vle-entget-60.lsp"   ("VLE-ENTGET dxf 60"   't_vle_entget_dxf60   300) )
    ("VLE" "Benches\\Vle\\vle-entget-62.lsp"   ("VLE-ENTGET dxf 62"   't_vle_entget_dxf62   300) )
    ("VLE" "Benches\\Vle\\vle-entget-67.lsp"   ("VLE-ENTGET dxf 67"   't_vle_entget_dxf67   300) )
    ("VLE" "Benches\\Vle\\vle-entget-210.lsp"  ("VLE-ENTGET dxf 210"  't_vle_entget_dxf210  300) )
    ("VLE" "Benches\\Vle\\vle-entget-370.lsp"  ("VLE-ENTGET dxf 370"  't_vle_entget_dxf370  300) )
    ("VLE" "Benches\\Vle\\vle-entget-330.lsp"  ("VLE-ENTGET dxf 330"  't_vle_entget_dxf330  300) )
    ("VLE" "Benches\\Vle\\vle-entget-390.lsp"  ("VLE-ENTGET dxf 390"  't_vle_entget_dxf390  300) )
    ("VLE" "Benches\\Vle\\vle-entget-410.lsp"  ("VLE-ENTGET dxf 410"  't_vle_entget_dxf410  300) )
    ("VLE" "Benches\\Vle\\vle-entget-420.lsp"  ("VLE-ENTGET dxf 420"  't_vle_entget_dxf420  300) )
    ("VLE" "Benches\\Vle\\vle-entget-m.lsp"    ("VLE-ENTGET-M"        't_vle_entget_m       300) )
    ("VLE" "Benches\\Vle\\vle-entget-massoc.lsp" ("VLE-ENTGET-MASSOC" 't_vle_entget_massoc  100) )

    ("VLE" "Benches\\Vle\\vle-entmod-6.lsp"    ("VLE-ENTMOD dxf 6"    't_vle_entmod_dxf6    150) )
    ("VLE" "Benches\\Vle\\vle-entmod-8.lsp"    ("VLE-ENTMOD dxf 8"    't_vle_entmod_dxf8    150) )
    ("VLE" "Benches\\Vle\\vle-entmod-10.lsp"   ("VLE-ENTMOD dxf 10"   't_vle_entmod_dxf10   150) )
    ("VLE" "Benches\\Vle\\vle-entmod-11.lsp"   ("VLE-ENTMOD dxf 11"   't_vle_entmod_dxf11   150) )
    ("VLE" "Benches\\Vle\\vle-entmod-60.lsp"   ("VLE-ENTMOD dxf 60"   't_vle_entmod_dxf60   150) )
    ("VLE" "Benches\\Vle\\vle-entmod-62.lsp"   ("VLE-ENTMOD dxf 62"   't_vle_entmod_dxf62   150) )
    ("VLE" "Benches\\Vle\\vle-entmod-210.lsp"  ("VLE-ENTMOD dxf 210"  't_vle_entmod_dxf210  150) )
    ("VLE" "Benches\\Vle\\vle-entmod-370.lsp"  ("VLE-ENTMOD dxf 370"  't_vle_entmod_dxf370  150) )
    ("VLE" "Benches\\Vle\\vle-entmod-m.lsp"    ("VLE-ENTMOD-M"        't_vle_entmod_m       150) )
;;  ("VLE" "Benches\\Vle\\vle-entmod-m-transaction.lsp"  ("VLE-ENTMOD-M-TRANSACTION"  't_vle_entmod_m_transaction  150) )

    ("VLE" "Benches\\Vle\\vle-dictobjname.lsp" ("VLE-DICTOBJNAME"     't_vle_dictobjname    250) )
    ("VLE" "Benches\\Vle\\vle-dictsearch.lsp"  ("VLE-DICTSEARCH"      't_vle_dictsearch     250) )
    ("VLE" "Benches\\Vle\\vle-tblsearch.lsp"   ("VLE-TBLSEARCH"       't_vle_tblsearch      350) )
    ("VLE" "Benches\\Vle\\vle-dictionary-list.lsp" ("VLE-DICTIONARY-LIST"  't_vle_dictionary_list  100) )
    ("VLE" "Benches\\Vle\\vle-table-list.lsp"      ("VLE-TABLE-LIST"       't_vle_table_list       100) )

    ("VLE" "Benches\\Vle\\vle-roundto.lsp"                 ("VLE-ROUNDTO"                 't_vle_roundto                 200) )

    ("VLE" "Benches\\Vle\\vle-vector-add.lsp"              ("VLE-VECTOR-ADD"              't_vle_vector_add              300) )
    ("VLE" "Benches\\Vle\\vle-vector-angleto.lsp"          ("VLE-VECTOR-ANGLETO"          't_vle_vector_angleto          300) )
    ("VLE" "Benches\\Vle\\vle-vector-angletoref.lsp"       ("VLE-VECTOR-ANGLETOREF"       't_vle_vector_angletoref       300) )
    ("VLE" "Benches\\Vle\\vle-vector-crossproduct.lsp"     ("VLE-VECTOR-CROSSPRODUCT"     't_vle_vector_crossproduct     400) )
    ("VLE" "Benches\\Vle\\vle-vector-dotproduct.lsp"       ("VLE-VECTOR-DOTPRODUCT"       't_vle_vector_dotproduct       400) )
    ("VLE" "Benches\\Vle\\vle-vector-get.lsp"              ("VLE-VECTOR-GET"              't_vle_vector_get              300) )
    ("VLE" "Benches\\Vle\\vle-vector-getperpvector.lsp"    ("VLE-VECTOR-GETPERPVECTOR"    't_vle_vector_getperpvector    300) )
    ("VLE" "Benches\\Vle\\vle-vector-getucs.lsp"           ("VLE-VECTOR-GETUCS"           't_vle_vector_getucs           300) )
    ("VLE" "Benches\\Vle\\vle-vector-iscodirectional.lsp"  ("VLE-VECTOR-ISCODIRECTIONAL"  't_vle_vector_iscodirectional  400) )
    ("VLE" "Benches\\Vle\\vle-vector-isequal.lsp"          ("VLE-VECTOR-ISEQUAL"          't_vle_vector_isequal          400) )
    ("VLE" "Benches\\Vle\\vle-vector-isparallel.lsp"       ("VLE-VECTOR-ISPARALLEL"       't_vle_vector_isparallel       400) )
    ("VLE" "Benches\\Vle\\vle-vector-isperpendicular.lsp"  ("VLE-VECTOR-ISPERPENDICULAR"  't_vle_vector_isperpendicular  400) )
    ("VLE" "Benches\\Vle\\vle-vector-isunitlength.lsp"     ("VLE-VECTOR-ISUNITLENGTH"     't_vle_vector_isunitlength     400) )
    ("VLE" "Benches\\Vle\\vle-vector-isxaxis.lsp"          ("VLE-VECTOR-ISXAXIS"          't_vle_vector_isxaxis          400) )
    ("VLE" "Benches\\Vle\\vle-vector-isyaxis.lsp"          ("VLE-VECTOR-ISYAXIS"          't_vle_vector_isyaxis          400) )
    ("VLE" "Benches\\Vle\\vle-vector-iszaxis.lsp"          ("VLE-VECTOR-ISZAXIS"          't_vle_vector_iszaxis          400) )
    ("VLE" "Benches\\Vle\\vle-vector-iszerolength.lsp"     ("VLE-VECTOR-ISZEROLENGTH"     't_vle_vector_iszerolength     400) )
    ("VLE" "Benches\\Vle\\vle-vector-length.lsp"           ("VLE-VECTOR-LENGTH"           't_vle_vector_length           400) )
    ("VLE" "Benches\\Vle\\vle-vector-length2d.lsp"         ("VLE-VECTOR-LENGTH2D"         't_vle_vector_length2d         400) )
    ("VLE" "Benches\\Vle\\vle-vector-length2dxz.lsp"       ("VLE-VECTOR-LENGTH2DXZ"       't_vle_vector_length2dxz       400) )
    ("VLE" "Benches\\Vle\\vle-vector-length2dyz.lsp"       ("VLE-VECTOR-LENGTH2DYZ"       't_vle_vector_length2dyz       400) )
    ("VLE" "Benches\\Vle\\vle-vector-negate.lsp"           ("VLE-VECTOR-NEGATE"           't_vle_vector_negate           400) )
    ("VLE" "Benches\\Vle\\vle-vector-normalise.lsp"        ("VLE-VECTOR-NORMALISE"        't_vle_vector_normalise        400) )
    ("VLE" "Benches\\Vle\\vle-vector-scale.lsp"            ("VLE-VECTOR-SCALE"            't_vle_vector_scale            400) )
    ("VLE" "Benches\\Vle\\vle-vector-sub.lsp"              ("VLE-VECTOR-SUB"              't_vle_vector_sub              400) )
    ("VLE" "Benches\\Vle\\vle-vector-midpoint.lsp"         ("VLE-VECTOR-MIDPOINT"         't_vle_vector_midpoint         400) )


    ;;========= OPTIMIZER Functions =============
    ("OPT" "Benches\\Optimizer\\opt-load.lsp"              ("OPTIMIZER (load <file>)"          't_opt_load              3) )
    ("OPT" "Benches\\Optimizer\\opt-progn.lsp"             ("OPTIMIZER (progn <expr>)"         't_opt_progn          1000) )

    ("OPT" "Benches\\Optimizer\\opt-notequal-nil.lsp"      ("OPTIMIZER (/= x nil)"             't_opt_notequal_nil    750) )
    ("OPT" "Benches\\Optimizer\\opt-=-nil.lsp"             ("OPTIMIZER (=  x nil)"             't_opt_numequal_nil    750) )
    ("OPT" "Benches\\Optimizer\\opt-eq-nil.lsp"            ("OPTIMIZER (eq x nil)"             't_opt_eq_nil          750) )
    ("OPT" "Benches\\Optimizer\\opt-equal-nil.lsp"         ("OPTIMIZER (equal x nil)"          't_opt_equal_nil       750) )
    ("OPT" "Benches\\Optimizer\\opt-vlax-getproperty.lsp"  ("OPTIMIZER (vlax-get-property)"    't_opt_vlax_get_prop   250) )

    ("OPT" "Benches\\Optimizer\\opt-nth-0.lsp"             ("OPTIMIZER (nth 0 lst)"            't_opt_nth_0          1500) )
    ("OPT" "Benches\\Optimizer\\opt-nth-5.lsp"             ("OPTIMIZER (nth 5 lst)"            't_opt_nth_5          1500) )
    ("OPT" "Benches\\Optimizer\\opt-nth-9.lsp"             ("OPTIMIZER (nth 9 lst)"            't_opt_nth_9          1500) )

    ("OPT" "Benches\\Optimizer\\opt-cdr-assoc.lsp"         ("OPTIMIZER (cdr (assoc x lst))"    't_opt_cdr_assoc             750) )
    ("OPT" "Benches\\Optimizer\\opt-cdr-assoc-entget.lsp"  ("OPTIMIZER (cdr (assoc (entget)))" 't_opt_cdr_assoc_entget      300) )
    ("OPT" "Benches\\Optimizer\\opt-rev-cdr-rev.lsp"       ("OPTIMIZER (reverse (cdr (reverse lst)))"  't_opt_rev_cdr_rev   500) )

    ("OPT" "Benches\\Optimizer\\opt-bool-tblsearch.lsp"    ("OPTIMIZER (not (tblsearch))"      't_opt_bool_tblsearch  350) )
    ("OPT" "Benches\\Optimizer\\opt-bool-dictsearch.lsp"   ("OPTIMIZER (not (dictsearch))"     't_opt_bool_dictsearch 350) )
    ("OPT" "Benches\\Optimizer\\opt-bool-entget.lsp"       ("OPTIMIZER (not (entget))"         't_opt_bool_entget     250) )


    ;;============ APPS Benchmarks =============
    ("USER" "Benches\\User\\App-SortedPoly.lsp"      ("USER SortedPoly"            't_app_sortedpoly      1) )
    ("USER" "Benches\\User\\App-SortedPoly-Opt.lsp"  ("USER SortedPoly Optimised"  't_app_sortedpoly_opt  1) )

  )
)

;;========= ADD FAS+DES Load/Run ===========
(setq BenchModules
  (append BenchModules
    (if (= cadsystem "ACAD")
      (list '("FAS" "Benches\\load-fas.lsp"  ("LOAD FAS  Big "  't_load_fas_big  10) ("LOAD FAS Small"  't_load_fas_small 150) ) )
      (list '("FAS" "Benches\\load-des.lsp"  ("LOAD DES  Big "  't_load_des_big  10) ("LOAD DES Small"  't_load_des_small 150) ) )
    )
  )
)
(setq BenchModules
  (append BenchModules
    (list '("FAS" "Benches\\load-lsp.lsp"    ("LOAD LSP  Big "  't_load_lsp_big  10) ("LOAD LSP Small"  't_load_lsp_small 150) ) )
  )
)


;;========= BENCHMARK COMMANDS =============
(defun C:Bench ()
  (setq $logfilename $logfilename_all)
  (_Bench '("ST" "VL" "VLA" "VLAX"))
)
(defun C:BenchS ()
  (setq $logfilename $logfilename_s)
  (_Bench '("ST"))
)
(defun C:BenchSV ()
  (setq $logfilename $logfilename_sv)
  (_Bench '("ST" "VL"))
)
(defun C:BenchV ()
  (setq $logfilename $logfilename_v)
  (_Bench '("VL" "VLA" "VLAX"))
)
(defun C:BenchVL ()
  (setq $logfilename $logfilename_vl)
  (_Bench '("VL"))
)
(defun C:BenchVLA ()
  (setq $logfilename $logfilename_vla)
  (_Bench '("VLA"))
)
(defun C:BenchVLAF ()
  (setq $logfilename $logfilename_vlafast)
  (_Bench '("VLA-Fast"))
)
(defun C:BenchVLAX ()
  (setq $logfilename $logfilename_vlax)
  (_Bench '("VLAX"))
)
(defun C:BenchUSER ()
  (setq $logfilename $logfilename_user)
  (setq $benchcyclespertest 1)
  (_Bench '("USER"))
)
(defun C:BenchVLE ()
  (if (findfile "vle-extension.lsp") (load "vle-extension.lsp"))
  (setq $logfilename $logfilename_vle)
 (_Bench '("VLE"))
)
(defun C:BenchFAS ()
  (setq $logfilename $logfilename_fas)
  (_Bench '("FAS"))
)
(defun C:BenchOPT ()
  (if (findfile "vle-extension.lsp") (load "vle-extension.lsp"))
  (setq $logfilename $logfilename_opt)
  (_Bench '("OPT"))
)


;;============= MAIN BENCH FUNCTION ==============
(defun _Bench ( benchmods  / ttime1 ttime2 date1 date2
                             totalcounter totalbenches totaltime totaltimeN totaltimeF
                             benchsecs  benchtime  averagetime
                             benchsecsN benchtimeN averagetimeN
                             benchsecsF benchtimeF averagetimeF
                             logfile runbench
                             item itemmod itemfile itemlist
                             benchfile benchitem benchname benchfunc benchcycles
                             olddimzin oldosmode oldluprec oldauprec
                             benchfile_loaded
               )

  (setq ttime1 (getvar "MILLISECS"))
  (if (not ttime1) (setq ttime1 (getvar "TDUSRTIMER")))
  (if (not ttime1) (setq ttime1 0.0))

  (setq olddimzin  (getvar "dimzin"))  (setvar "dimzin"  0)
  (setq oldosmode  (getvar "osmode"))  (setvar "osmode"  0)
  (setq oldluprec  (getvar "luprec"))  (setvar "luprec"  4)
  (setq oldauprec  (getvar "auprec"))  (setvar "auprec"  2)
  (setq oldcmdecho (getvar "cmdecho")) (setvar "cmdecho" 0)

  (setq logfile (open $logfilename "w"))

  (setq totaltime 0.0 totaltimeN 0.0 totaltimeF 0.0)
  (setq totalcounter 0)

  (foreach item BenchModules

    (setq itemmod  (car item) item     (cdr item))
    (setq itemfile (car item) itemlist (cdr item))
    
    (if (member itemmod benchmods)
      (progn
        ;; --- get the testcode file
        (setq benchfile (findfile itemfile))
        (cond
          ((not benchfile)
           (princ (strcat "\n*** Error : Benchmark file not found : " itemfile))
           (if logfile
             (princ (strcat "\n*** Error : Benchmark file not found : " itemfile) logfile)
           )
          )
          ;; --- now run this benchmark, if test is in categories list
          (T
           (setq benchfile_loaded nil)
        
           (foreach benchitem itemlist
        
             (setq benchname   (car   benchitem))
             (setq benchfunc   (cadr  benchitem))
             (setq benchcycles (caddr benchitem))
        
             (if (/= $benchcyclesfactor 1)
               (setq benchcycles (fix (* benchcycles $benchcyclesfactor)))
             )
        
             ;;------ check wether to run this bench -------
             (setq runbench NIL)
             (if (not $includebenches)
               (setq runbench T)
             )
             (if (member benchname $excludebenches)
               (setq runbench NIL)
             )
             (if (member benchname $includebenches)  ;; has priority over '$excludebenches'
               (setq runbench T)
             )
             ;;---------------------------------------------
        
             (if runbench
               (progn
        
                 ;;----- load the benchmark file, if not yet loaded -----
                 (if (not benchfile_loaded)
                   (progn
                     (load benchfile)
                     (setq benchfile_loaded t)
                   )
                 )
        
                 (if (eval benchfunc)  ;; test wether it exists
                   (progn
        
                     (princ "\n")
                     (if logfile (princ "\n" logfile))
        
                     (setq averagetime 0.0 averagetimeN 0.0 averagetimeF 0.0)
                     (setq benchtime 0.0   benchtimeN 0.0   benchtimeF 0.0)
                     (setq benchsecs 0.0   benchsecsN 0.0   benchsecsF 0.0)
                     (setq bench$secsNorm 0.0 bench$secsFast 0.0)
        
                     (repeat $benchcyclespertest
                       (setq benchsecs  (apply (eval benchfunc) (list benchcycles logfile)))
                       (setq benchtime  (+ benchtime benchsecs))
                       (setq benchtimeN (+ benchtimeN bench$secsNorm))
                       (setq benchtimeF (+ benchtimeF bench$secsFast))
                     )
        
                     (setq averagetime  (/ benchtime  $benchcyclespertest))
                     (setq averagetimeN (/ benchtimeN $benchcyclespertest))
                     (setq averagetimeF (/ benchtimeF $benchcyclespertest))
        
                     (if (/= itemmod "VLE")
                       (progn
                         (princ (strcat "* " benchname " : Total time = " (rtos benchtime 2 3) ", Average time = " (rtos averagetime 2 3) " [secs]\n"))
                         (if logfile (princ (strcat "* " benchname " : Total time = " (rtos benchtime 2 3) ", Average time = " (rtos averagetime 2 3) " [secs]\n") logfile))
                       )
                       (progn
                         (princ (strcat "* " benchname " : Total time = " (rtos benchtimeN 2 3) " / " (rtos benchtimeF 2 3) ", Average time = " (rtos averagetimeN 2 3) " / " (rtos averagetimeF 2 3) " [secs]\n"))
                         (if logfile (princ (strcat "* " benchname " : Total time = " (rtos benchtimeN 2 3) " / " (rtos benchtimeF 2 3) ", Average time = " (rtos averagetimeN 2 3) " / " (rtos averagetimeF 2 3) " [secs]\n") logfile))
                       )
                     )
        
                     (setq totaltime  (+ totaltime  benchtime))
                     (setq totaltimeN (+ totaltimeN benchtimeN))
                     (setq totaltimeF (+ totaltimeF benchtimeF))
        
                     (setq totalcounter (1+ totalcounter))
                   )
                 )
        
               )
        
             )
        
           )
        
          )
          ;;---------------------------
        )
      )
    )

  )

  ;; ==== Benches Finished ===

  (if (= totalcounter 0)
    (progn
      (princ "\n\n*** No Benchmarks selected - please check '$includebenches' and '$excludebenches' definitions.\n\n")
      (exit)
    )
  )

  (setq totalbenches (* totalcounter $benchcyclespertest))

  ;; ===== Total Summary =====
  (if (or (= itemmod "VLE") (equal benchmods '("VLE")))
    (progn
                  (princ (strcat "\n\n*** Total Benchmark Time  : " (rtos totaltimeN 2 3) " / " (rtos totaltimeF 2 3) " [secs] (" (itoa totalcounter) " Tests)"))
      (if logfile (princ (strcat "\n*** Total Benchmark Time  : " (rtos totaltimeN 2 3) " / " (rtos totaltimeF 2 3) " [secs] (" (itoa totalcounter) " Tests)") logfile))
                  (princ (strcat "\n*** Average Time per Mark : " (rtos (/ totaltimeN totalbenches) 2 3) " / " (rtos (/ totaltimeF totalbenches) 2 3) " [secs]"))
      (if logfile (princ (strcat "\n*** Average Time per Mark : " (rtos (/ totaltimeN totalbenches) 2 3) " / " (rtos (/ totaltimeF totalbenches) 2 3) " [secs]") logfile))
    )
    (progn
                  (princ (strcat "\n\n*** Total Benchmark Time  : " (rtos totaltime 2 3) " [secs]  (" (itoa totalcounter) " Tests)"))
      (if logfile (princ (strcat "\n*** Total Benchmark Time  : " (rtos totaltime 2 3) " [secs]  (" (itoa totalcounter) " Tests)") logfile))
                  (princ (strcat "\n*** Average Time per Mark : " (rtos (/ totaltime totalbenches) 2 3) " [secs]"))
      (if logfile (princ (strcat "\n*** Average Time per Mark : " (rtos (/ totaltime totalbenches) 2 3) " [secs]") logfile))
    )
  )
  ;;=============================

  (setq ttime2 (getvar "MILLISECS"))
  (if (not ttime2) (setq ttime2 (getvar "TDUSRTIMER")))
  (if (not ttime2) (setq ttime2 0.0))

  ;;-----------------------------
              (princ (strcat "\n*** Total Processing Time : " (rtos (if (getvar "MILLISECS") (* 0.001 (- ttime2 ttime1)) (* 86400.0 (- ttime2 ttime1))) 2 3) " [secs]"))
  (if logfile (princ (strcat "\n*** Total Processing Time : " (rtos (if (getvar "MILLISECS") (* 0.001 (- ttime2 ttime1)) (* 86400.0 (- ttime2 ttime1))) 2 3) " [secs]\n")))
  ;;-----------------------------
  (princ "\n\n*** Total Memory Usage : ") (mem)

  ;;(if logfile
  ;;  (princ "\n\n*** Total Memory Usage : ")
  ;;)

  (if logfile (close logfile))

  (setq tmpfile (strcat $BenchTempFolder "readwrite-line.log"))
  (if vl-file-delete (vl-file-delete tmpfile))
  (setq tmpfile (strcat $BenchTempFolder "readwrite-char.log"))
  (if vl-file-delete (vl-file-delete tmpfile))
  (setq tmpfile (strcat $BenchTempFolder "open-close.log"))
  (if vl-file-delete (vl-file-delete tmpfile))

  (setvar "dimzin"  olddimzin)
  (setvar "osmode"  oldosmode)
  (setvar "luprec"  oldluprec)
  (setvar "auprec"  oldauprec)
  (setvar "cmdecho" oldcmdecho)

  (princ)
)

(princ "\n")
(princ "\n* Commands : BENCH ....... all functions")
(princ "\n*            BENCHS ...... ST")
(princ "\n*            BENCHSV ..... ST + VL")
(princ "\n*            BENCHV ...... VL + VLA + VLAX")
(princ "\n*            BENCHVL ..... VL")
(princ "\n*            BENCHVLA .... VLA")
(princ "\n*            BENCHVLAX ... VLAX")
(princ "\n")
(princ "\n*            BENCHVLAF ... VLA (Fast COM)")
(princ "\n")
(princ "\n*            BENCHVLE .... VLE Lisp")
(princ "\n*            BENCHOPT .... Optimizer")
(princ "\n")
(princ "\n*            BENCHUSER ... User & Application Benchmarks")
;;(princ "\n")
;;(princ "\n*            BENCHFAS .... FAS vs. DES load & run")
(princ "\n")

(princ)

