Version 12 is Slower then Version 11

 Is it true that Ver 12 for windows is slower then Ver 11 ??
I called for an ascii file of 3000 points containing Point number, Easting, Northing and Heigh, in that order.
Ver 11 loaded the file in less then 5 seconds.
Ver 12 loaded the same file in something like 20 seconds.
Please advice.

Comments

  • If you have in this DWG xrefs, try command SCALELISTEDIT. If you have here lot of scalelists, you must delete it.
  •  Hi.
    Thank's, I tried your suggestion, but to no avail.
    I'm a surveyor, and what I do is to enter a list of points to a new and empty drawing. The only thing is that the Drawing is a template that has all the layers in advance. The point file is of the following example:
             1 216503.12 667050.72    553.80
             2 216505.07 667073.83    553.25
             3 216500.13 667050.75    552.09
             4 216501.96 667072.75    551.75
             .
             .
             .

          3299 216767.36 667040.75    565.33
          3300 216762.87 667043.02    565.63
          3301 216763.20 667039.58    565.78
          3302 216766.18 667038.81    565.48
          3303 216767.36 667040.75    565.33
    It comprises of Point number, Easting, Northing and elevation.
    I'm using a macro that works fine in version 11.4.6. What it does is to put the point number and elevation as attributes to a block point. It checks for codes for trees, poles, hidrant, etc.. 
    If the point is preceded by a number rather than a code, it uses a simple block.
    As I mentioned before, that worked fine on version 7, as on version 11. It works O.K. on version 12, only slower. A file of 3000 points takes about 20 seconds to load, when less then 5 seconds on previous versions.
    I enclose here the code of my routine.

    *****************************************

    (defun DecPlace (z kk)
      (setq inc -1)
      (while (not (or (and
              (/= kk (setq inc (1+ inc)))
              (= "." (substr z (- kk inc) 1))
      ))))
    )


    (Defun LspcR ()
      (SetQ nn 1)
      (While (= (Substr rec nn 1) " ")  ; .„ƒ…—„ ˜”‘Ž ‰”Œ™ ‰‡……˜Ž„ šƒ˜…„
       (SetQ nn (1+ nn))
      )
      (SetQ rec (SubStr rec nn))

      (SetQ n 1)
      (While (/= (Substr rec n 1) " ")  ; .…™€˜ ‡……˜Ž ™”‡Ž
       (SetQ n (1+ n))
      )
    )
    ;;;------ š†…˜‡Ž„ Š˜…€ ‰”Œ ƒ…’… Z „…‚ ‰……š„ ˜”‘Ž —ƒ… --------
    (Defun OrehZ ()
      (If (/= z 0)
       (Progn
        (SetQ k (Strlen z$))        ;k = š†…˜‡Ž„ Š˜…€
        (DecPlace z$ k)    ;k1 = „ƒ…—„ ƒ’ š…˜”‘„ ˜”‘Ž
        (SetQ k1 (- k inc 1)
              prec inc         ;prec = „ƒ…—„ ‰˜‡€ š…˜”‘„ ˜”‘Ž
                 z$ (StrCat (SubStr z$ 1 k1) " " (SubStr z$ (+ k1 2)))
        )
        (Cond
         ((= prec 2)
          (If (= 6 k) (SetQ z$ (StrCat z$ " ")))
          (If (= 4 k) (SetQ z$ (StrCat " " z$)))
         )
         ((= prec 3)
          (If (= 6 k) (SetQ z$ (StrCat " " z$)))
          (If (= 5 k) (SetQ z$ (StrCat "  " z$)))
         )
         ((= prec 4)
          (If (= 8 k) (SetQ z$ (StrCat " " z$)))
          (If (= 7 k) (SetQ z$ (StrCat "  " z$)))
          (If (= 6 k) (SetQ z$ (StrCat "   " z$)))
         )
        );cond
       )
       (SetQ z 0.0 z$ " ")
      )
    )
    ;;;--------------------------Spin-------------------------------------------------
    ;;; Prints a pinwheel on the command line
     (defun Spin ( )
      (setq SYMAN
      (cond
       ((= SYMAN nil) "-")
       ((= SYMAN "-") "\\")
       ((= SYMAN "\\") "|")
       ((= SYMAN "|") "/")
       ((= SYMAN "/") "-")
      )
     )
     (princ (strcat "\r Working... " SYMAN "                                    "))
    );end spin

    (Defun C:Ptn (/ cl act size i n nn x y z rec fn date koter scl scl-e scl-ee
                    fd fid)
    ;;; Defining Variables.
     (SetQ date (getstring  "\nEnter Date in format 2011-12-31 : "))
     (SetQ koter (getstring  "\nEnter Koter Shuha  : "))
     (SetQ Gush  (getstring  "\nEnter Gush No.  : "))
     (SetQ yesno (ukword 1 "Yes No" "Add Sograim to Gova ? [Y/N] " yesno))
    ;;;; (SetQ prec (uint 5 "" "Precision" prec))
     (setvar "cmdecho" 0)
     (SetQ cl (GetVar "clayer"))
     (SetVar "attdia" 0)
     (If (= #knm 0) (SetQ #knm (Getreal "Scale... 1:")))
      (SetVar "userR1" #knm)
      (SetVar "TEXTSIZE" (* #knm 0.0017))
      (SetQ #htxt (* #knm 0.0017)
              scl (* 0.001 #knm)
            scl-e (* 0.010 #knm)
           scl-ee (* 0.005 #knm)
                n 1
      )
      (Setvar "HPSCALE" scl-e)
      (SetVar "ltscale" scl-e)
     (If (= (GetVar "PDSIZE") 0.00)
       (Progn
           (SetQ act (ukword 1 "P C N" "Point mode : Point/Cross/Nopoint " act))
           (Cond
            ((Eq act "P") (SetQ act 32 size 2.3))
            ((Eq act "C") (SetQ act 2 size 1))
            ((Eq act "N") (SetQ act 0 size 1))
           )
          (SetVar "PDMODE" act)
          (SetVar "PDSIZE" (* #knm 0.0005 size))
        ) ; progn
     ) ; if
    ;------------------------------------------------------------------

     (DDOPEN "Select XYZ File" "tac")

      (while (SetQ rec (read-line fd))

      (spin)
      (LspcR)
       (SetQ bl (Substr rec 1 (1- n)))
       (SetQ rec (SubStr rec (1+ n)))
      (LspcR)
       (SetQ y (Atof (Substr rec 1 (1- n))))
       (SetQ rec (SubStr rec (1+ n)))
      (LspcR)
       (SetQ x (Atof (Substr rec 1 (1- n))))
       (SetQ z$ (SubStr rec (1+ n)))
       (SetQ z (Atof z$))

      (SetQ nn 1)
      (While (= (Substr z$ nn 1) " ")  ; .„ƒ…—„ ˜”‘Ž ‰”Œ™ ‰‡……˜Ž„ šƒ˜…„
       (SetQ nn (1+ nn))
      )
      (SetQ z$ (SubStr z$ nn))

       (Orehz)

       (SetQ x1 (+ x (* 0.002 #knm))
             y1 (+ y (* 0.002 #knm))
       )


      (Cond
      ((/= (substr bl 1 1) ".")
       (Command "layer" "s" "1502-BK" "")
       (If (Eq yesno "Yes") (SetQ z$ (Strcat "(" z$ ")")))
       (command "insert" "1502" (list y x z) scl "" "0" z$ bl)
       (SetQ flg "off")
      )

    ;------------------------------------------------
      ((= (substr bl 1 1) ".")
      (Cond
    ; Œ…‚ šƒ…—
       ((Eq (substr bl 2 2) "00")
        (Command "layer" "s" "1610" "")
        (command "insert" "ESI-00" (list y x z) scl-e "" "0" (substr bl 4))
       )

    ; „—Œ‡„ ˜”‘Ž
       ((Eq (substr bl 2 2) "10")
        (Command "layer" "s" "1602-BT" "")
        (command "insert" "1602" (list y x z) scl "" "0" (substr bl 4) "" Gush "" "")
       )



    ; ‚ š˜…€š ƒ…Ž’
       ((Eq (substr bl 2 2) "33")
        (Command "layer" "s" "4403-BK" "")
        (command "insert" "4403" (list y x z) scl-e "" "0" (substr bl 4))
       )

    ;  ‰€™ ˆ"š
       ((Eq (substr bl 2 2) "34")
        (Command "layer" "s" "6201-BK" "")
        (command "insert" "6201" (list y x z) scl "" "0" (substr bl 4) "")
       )

    ;  „Œš™„„ ˜‡€Œ ‰…‰™Œ - š‰ŒŒ‹ „‡…™
       ((Eq (substr bl 2 2) "98")
        (Command "layer" "s" "3906-BK" "")
        (command "insert" "3906" (list y x z) scl "" "0" (substr bl 4) "")
       )

    ; ŒŽ™‡ ‡…Œ
       ((Eq (substr bl 2 2) "28")
        (Command "layer" "s" "2458-BK" "")
        (command "insert" "ESI-64" (list y x z) scl-e "" "0")
       )

    ;  „Œš™„„ ˜‡€Œ ‰…‰™Œ - ‰ŒŒ‹ „‘‹Ž
       ((Eq (substr bl 2 2) "29")
        (Command "layer" "s" "0" "")
        (command "insert" "0001" (list y x z) scl "" "0" (substr bl 4))
       )


    ;  „Œš™„„ ˜‡€Œ ‰…‰™Œ - ‰ŒŒ‹ —…Œ
       ((Eq (substr bl 2 2) "99")
        (Command "layer" "s" "0" "")
        (command "insert" "0000" (list y x z) scl "" "0" (substr bl 4))
       )


    ; š’™Ž = ‚…’ ƒ…Ž’
       ((Eq (substr bl 2 2) "51")
        (Command "layer" "s" "2458-BK" "")
        (command "insert" "ESI-51" (list y x z) scl-e "" "0")
       )

    ; ˜…‰–
       ((Eq (substr bl 2 2) "52")
        (Command "layer" "s" "2458-BK" "")
        (command "insert" "ESI-52" (list y x z) scl-e "" "0")
       )


    ; ‘Œ˜
       ((Eq (substr bl 2 2) "53")
        (Command "layer" "s" "2458-BK" "")
        (command "insert" "ESI-53" (list y x z) scl-e "" "0")
       )

    ; š™ ƒ…Ž’
       ((Eq (substr bl 2 2) "54")
        (Command "layer" "s" "2458-BK" "")
        (command "insert" "ESI-54" (list y x z) scl-e "" "0")
       )

    ; …ˆ ƒ…Ž’
       ((Eq (substr bl 2 2) "55")
        (Command "layer" "s" "2458-BK" "")
        (command "insert" "ESI-55" (list y x z) scl-e "" "0")
       )


    ; „˜’Ž
       ((Eq (substr bl 2 2) "93")
        (Command "layer" "s" "2415-BT" "")
        (command "insert" "ESI-93" (list y x z) scl-e "" "0")
       )

    ; …”Œˆ ƒ…Ž’
       ((Eq (substr bl 2 2) "76")
        (Command "layer" "s" "3902-BK" "")
        (command "insert" "3902" (list y x z) scl "" "0" (substr bl 4) "")
       )

    ; š‚……‘Ž €Œ „ˆ€
       ((Eq (substr bl 2 2) "57")
        (Command "layer" "s" "3950-BK" "")
        (command "insert" "3950" (list y x z) scl "" "0" (substr bl 4))
       )

    ;  ˆŒ™
       ((Eq (substr bl 2 2) "60")
        (Command "layer" "s" "4422-BK" "")
        (command "insert" "4422" (list y x z) scl "" "0" (substr bl 4))
       )

    ; ˜…†Ž˜
       ((Eq (substr bl 2 2) "61")
        (Command "layer" "s" "4409-BK" "")
        (command "insert" "4409" (list y x z) scl "" "0" (substr bl 4))
       )

    ; ˜…˜Žš
       ((Eq (substr bl 2 2) "62")
        (Command "layer" "s" "2451-BK" "")
        (command "insert" "2451" (list y x z) scl "" "0" (substr bl 4))
       )

    ; „—˜€„
       ((Eq (substr bl 2 2) "64")
        (Command "layer" "s" "3912-BK" "")
        (command "insert" "3912" (list y x z) scl "" "0")
       )

    ; “€ Œ‚Œ‚
       ((Eq (substr bl 2 2) "R2")
        (Command "layer" "s" "2439-BK" "")
        (command "insert" "GALGAL" (list y x z) scl "" "0")
       )

    ; ˜…–’ ˆŒ™
       ((Eq (substr bl 2 2) "S1")
        (Command "layer" "s" "2439-BK" "")
        (command "insert" "B-37" (list y x z) scl "" "0")
       )

    ; ˜™‰ •‡
       ((Eq (substr bl 2 2) "S2")
        (Command "layer" "s" "2439-BK" "")
        (command "insert" "HETZ1" (list y x z) scl-ee "" "0")
       )

    ; „‰Ž‰ •‡
       ((Eq (substr bl 2 2) "S3")
        (Command "layer" "s" "2439-BK" "")
        (command "insert" "HETZ1R" (list y x z) scl-ee "" "0" )
       )

    ; „Œ€Ž™ •‡
       ((Eq (substr bl 2 2) "S4")
        (Command "layer" "s" "2439-BK" "")
        (command "insert" "HETZ1L" (list y x z) scl-ee "" "0")
       )



    ; Œ…Œ‘Ž š˜…€š (ƒƒ… ‘”)
       ((Eq (substr bl 2 2) "PN")
        (Command "layer" "s" "2441-BK" "")
        (command "insert" "2441" (list y x z) scl "" "0" (substr bl 4))
       )

    ; Œ…Œ‘Ž š˜…€š (š‰‡)
       ((Eq (substr bl 2 2) "PH")
        (Command "layer" "s" "2441-BK" "")
        (command "insert" "2441H" (list y x z) scl "" "0" (substr bl 4))
       )

      ) ; cond
    ;------------------------------------------
        (SetQ n (1+ n))
       ) ; Cond
      ) ; Cond

        (If (= flg "on")
         (progn
           (Command "layer" "s" "1502-BK" "")
           (If (Eq yesno "Yes") (SetQ z$ (Strcat "(" z$ ")")))
           (command "insert" "1502" (list y x z) scl "" "0" z$ " ")
         )
         (SetQ flg "on")
        )

     ) ;While
      (command "layer" "s" cl "")
    ;;;  (SetVar "Blipmode" "ON")
      (SetVar "attdia" 1)
      (Princ  "\nFinished")
     (SetQ fd (Close fd))
    (princ)
    )
    (c:ptn)


  • I just compared LISP speed for V12 and V11 using test at http://cadsoft.lt/f/index.php/topic,25.0.html and had received next output:

    V12
    Bricscad 18.0Bricscad
    ==========
    10000 cycles:
    0.36897808 s
    100000 cycles:
    3.93399596 s

    V11
    Bricscad 17.2 Bricscad
    ==========
    10000 cycles:
    0.27901679 s
    100000 cycles:
    2.75500417 s

    As you can compare, the difference in time is not too big as you described. By the way, you can test it on AutoCAD too :)

    Regarding the LISP code below, it looks like multiply checks of Point Codes are slowing insertion. I also tested my application http://cadsoft.lt/en/catalogue/cad-software/developer/in-axis/kitox-lg with insertion of 3000 blocks using point numbers, codes and heights and it was performed a little bit faster for 3000 points:
    : inax:pt-import
    Loading...
    3000 Points imported
    Time: 1.31401420 s

    My suggestion is to review a LISP code. I think insertion of blocks without checking of codes will work faster. Just replace blocks after additional checking.

    Regards, Vaidas


  •  Hi.
    I switched from Autocad years ago, and don't intend to switch back.
    I know that without checking for codes, the routine responds almost instantly.
    But the same routine with checking for codes, does work much faster with Version 11.
    The Lisp I sent you is just a fraction of the real macro as I've more than 100 codes for GIS entities measured in the field

  • Three more suggestions:

    1.
    Store the entire content of the text file in a list-of-strings and process that list in a next step.
    Instead of your current "per-line" approach.

    2.
    Disable the spinner code.

    3.
    Try using (vle-start-transaction) and (vle-end-transaction).
    Check the vle-extension.lsp file in the BC folder for more info.

  • And another:

    4.
    In your code you use this very often:
    [code](eq (substr bl 2 2) ...)[/code]
    Try this instead:
    [code](setq bl_2_2 (substr bl 2 2))
    (eq bl_2_2 ...)[/code]


  • 5. (vla-InsertBlock) will work faster than (command "insert")

    Regards, Vaidas
  • You might consider sending in a support request also. I have had extremely helpful replies to my requests concerning Lisp routines.
  • Dear Raam, Dear All,

    up to latest V12.2.8, there was a performance regression for (read-line) function - fixed with V12.2.9 and later;
    a fix to allow "binary strings" (containing 0x0 characters inside a file line) caused that performance regression, which was by around factor 3.

    Since V12.2.9, the performance should be back to V11 level (or even a bit faster).

    Please try V12.2.9 or higher, and report whether your initial issue has been solved.

    Greetings to all !
This discussion has been closed.