Author Topic: entmake/ActiveX race  (Read 19576 times)

0 Members and 1 Guest are viewing this topic.

daron

  • Guest
entmake/ActiveX race
« on: October 29, 2003, 04:03:49 PM »
Quote from: SMadsen
But inserting the block I would probably do with ENTMAKE. It's fast, it's clean and it can be tested more easily than a command (unless VL-CMDF is used).
Good point. ActiveX is good way too, though probably still a little more code work than entmake. Anybody up for a race?

SMadsen

  • Guest
entmake/ActiveX race
« Reply #1 on: October 29, 2003, 04:51:49 PM »
Do you mean race in CPU speed or in typing?

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
entmake/ActiveX race
« Reply #2 on: October 29, 2003, 05:06:41 PM »
I don't use ENTMAKE any more. I got bit by the e-lock violation bug(?) once and that was enough. So now I create everything using ActiveX. I'm not positive, but I think they have resolved e-lock violation issue in 2004.

Anyone know for sure?
TheSwamp.org  (serving the CAD community since 2003)

SMadsen

  • Guest
entmake/ActiveX race
« Reply #3 on: October 29, 2003, 05:16:35 PM »
After installing 2004 I have not experienced any problems with mixing AutoLISP and ActiveX to modify the database, so yes, own experience and what I've heard all around point to the possibility that they have fixed it.

Of course, I got in the habit not to mix it before due to what you describe, so own experience may not count that much :)

Now we only have to wait until 2010 when 2002 is a bygone, then it should be safe. Then there's only the matter if AutoLISP will still be supported at that time. Oh well. That's life.

daron

  • Guest
entmake/ActiveX race
« Reply #4 on: October 29, 2003, 05:18:36 PM »
I meant entmake vs. ActiveX. Say insert a block named circ, containing a circle drawn at 2in. I think that's 5.08cm for Stig. on layer 0, color white, linetype continuous. Inserted 1000 times. So yes, CPU speed test, like before.

SMadsen

  • Guest
entmake/ActiveX race
« Reply #5 on: October 29, 2003, 05:53:16 PM »
Using the timer from previously threads, I get readings between 3.45 and 3.65 seconds with the functions below.

Within 12 runs (12.000 inserts) it made an average of 3.55 seconds pr. 1000 inserts.

Code: [Select]
(defun startTimer () (setq time (getvar "DATE")))

(defun endTimer (func)
  (setq time    (- (getvar "DATE") time)
        seconds (* 86400.0 (- time (fix time)))
  )
  (gc)
  (outPut seconds func)
)

(defun outPut (secs def)
  (gc)
  (princ (strcat "\nTimed " def ": " (rtos secs 2 6)))
  (princ)
)

(defun insCircle (/ bname)
  (setq bname "circ")
  (startTimer)
  (repeat 1000
    (entmake (list '(0 . "INSERT")
                   '(100 . "AcDbEntity")
                   '(100 . "AcDbBlockReference")
                   (cons 2 "circ")
                   (cons 8 "0")
                   '(10 0.0 0.0 0.0)
             )
    )
  )
  (endTimer "insCircle")
)

daron

  • Guest
entmake/ActiveX race
« Reply #6 on: October 29, 2003, 06:42:25 PM »
I'll have to get back to this in the morning. I'll test my function and let you know then. See you tomorrow. BTW Stig, did you register in time to get classes at AU?

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
entmake/ActiveX race
« Reply #7 on: October 29, 2003, 08:36:49 PM »
Don't know if i did it right?
But this what i  get.


Code: [Select]
Command: timer
Timed insCircle: 0.079983
Command:
Command: timer
Timed insCircle: 0.080024
Command:
Command: timer
Timed insCircle: 0.090002
Command:
Command: timer
Timed insCircle: 0.079983
Command:
Command: timer
Timed insCircle: 0.079983
Command:
Command: timer
Timed insCircle: 0.090002
Command:
Command: timer
Timed insCircle: 0.090002
Command:
Command: timer
Timed insCircle: 0.090967
Command:
Command: timer
Timed insCircle: 0.090002
Command:
Command: timer
Timed insCircle: 0.080024
Command:
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

SMadsen

  • Guest
entmake/ActiveX race
« Reply #8 on: October 30, 2003, 06:19:54 AM »
If you created a block called "circ" with the spec's that Daron stated then did it right, CAB.
Thanks for revealing that my pc is really old and slow!  Heh

Of course, a benchmark test is to be tested on the same pc and the same environment. No two different setups give the same readings.
With my pc at work I get 0.75 in average. Still a pc much slower than yours!

daron

  • Guest
entmake/ActiveX race
« Reply #9 on: October 30, 2003, 10:29:27 AM »
Well, here's my version. Stig, Entmake is faster than what I could come up with. I tried mine four times and your's once. Times posted at the bottom. Mark, do you have an ActiveX function that'll outperform mine?
Code: [Select]
(defun c:instest ()
     (defun startTimer () (setq time (getvar "DATE")))

     (defun endTimer (func)
 (setq time (- (getvar "DATE") time)
seconds (* 86400.0 (- time (fix time)))
 )
 (gc)
 (outPut seconds func)
     )

     (defun outPut (secs def)
 (gc)
 (princ (strcat "\nTimed " def ": " (rtos secs 2 6)))
 (princ)
     )
     (startTimer)
     (repeat 1000
 (vla-InsertBlock
      (vla-get-modelspace
   (vla-get-activedocument
(vlax-get-acad-object)
   )
      )
      (vlax-3d-point 0 0 0)
      "circ"
      (vlax-make-variant 1.0 vlax-vbDouble)
      (vlax-make-variant 1.0 vlax-vbDouble)
      (vlax-make-variant 1.0 vlax-vbDouble)
      (vlax-make-variant 0.0 vlax-vbDouble)
 )
     )
     (endTimer "instest")
)

1.547004
1.593997
1.594037
1.609004
0.672014 Stig's function

daron

  • Guest
entmake/ActiveX race
« Reply #10 on: October 30, 2003, 10:38:26 AM »
CAB, what are the spec's of your computer. Your times are blazingly fast. I should be getting a new computer soon. My lease is up. WooHoo.

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
entmake/ActiveX race
« Reply #11 on: October 30, 2003, 10:39:26 AM »
Quote
Mark, do you have an ActiveX function that'll outperform mine?
I doubt it. Have you tried getting rid of the vlax-make-variant 0.0 vlax-vbDouble and see if it gets any faster?
TheSwamp.org  (serving the CAD community since 2003)

daron

  • Guest
entmake/ActiveX race
« Reply #12 on: October 30, 2003, 10:58:52 AM »
Just tried it. Get's slower with each pass. Restarted computer and retried it. A smidgen quicker, not good.
1.49972

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
entmake/ActiveX race
« Reply #13 on: October 30, 2003, 11:17:57 AM »
Actually my wife's computer is faster than mine but I can't get her to see that I need it more.


No Name Box w/ Asus A7A266 mother board w/ AMD 1.4 ghz 512M ram  G450 graphics card
40G HD 7200rpm  80G HD 7200rpm


Puny 15" CRT, any suggestions??   keep $$$ in mind.


The routine does get slower with each run.

________________________
edit* I think changing here to her clarifies it better.
________________________
CAB
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
entmake/ActiveX race
« Reply #14 on: October 30, 2003, 11:22:36 AM »
Quote from: CAB
Actually my wife's computer is faster than mine but I can't get here to see that I need it more.


No Name Box w/ Asus A7A266 mother board w/ AMD 1.4 ghz 512M ram  G450 graphics card
40G HD 7200rpm  80G HD 7200rpm


Puny 15" CRT, any suggestions??   keep $$$ in mind.

CAB, are you buying or selling? Help......i'm lost here :D
TheSwamp.org  (serving the CAD community since 2003)