Author Topic: Wow... it sure does matter how you do it  (Read 2581 times)

0 Members and 1 Guest are viewing this topic.

gskelly

  • Newt
  • Posts: 185
Wow... it sure does matter how you do it
« on: April 02, 2009, 11:08:45 PM »
I was quite surprised by how different the runtime is to transpose a list of lists  :-o

Guess I am starting to understand why you folks discuss and compare methods so much.

Results:
Code: [Select]
: (load "transpose_with_func")
C:DOIT
: doit

==============================================================
 Testing transpose with vlax-variant-value: many cols few rows
Elapsed milliseconds / relative speed for 1024 iteration(s):

    (TRANS3 DATA)......1124 / 18.1 <fastest>
    (TRANS1 DATA).....17593 / 1.16
    (TRANS2 DATA).....20342 / 1 <slowest>

==============================================================
 Testing transpose with vlax-variant-value: many rows few cols
Elapsed milliseconds / relative speed for 1024 iteration(s):

    (TRANS3 DATA).....1312 / 1.37 <fastest>
    (TRANS2 DATA).....1750 / 1.03
    (TRANS1 DATA).....1796 / 1 <slowest>

Using code in the attached file.

PS: This came about because I got a friend to test a routine on Autocad and it did not perform very well. I've since noticed this test runs almost an order of magnitude slower on Autocad on a similar (but not identical) machine. Is there something I've done Autocad does not like or is there a more intelligent way to transform these variants to values?

Greg
« Last Edit: April 03, 2009, 12:41:38 AM by gskelly »
Bricscad v12

jxphklibin

  • Guest
Re: Wow... it sure does matter how you do it
« Reply #1 on: April 02, 2009, 11:20:32 PM »
Where is the files (load "Benchmark")?

gskelly

  • Newt
  • Posts: 185
Re: Wow... it sure does matter how you do it
« Reply #2 on: April 02, 2009, 11:29:06 PM »
Where is the files (load "Benchmark")?

Oops... sorry. You can find it in this topic: http://www.theswamp.org/index.php?topic=3952.msg47217#msg47217
Bricscad v12

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Wow... it sure does matter how you do it
« Reply #3 on: April 02, 2009, 11:50:18 PM »
Too tired to look at this tonight but trans3 has an error.
Code: [Select]
(mapcar '(lambda(x) (mapcar 'vlax-variant-value x)) rsdata)This does nothing with the variant value.

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

gskelly

  • Newt
  • Posts: 185
Re: Wow... it sure does matter how you do it
« Reply #4 on: April 03, 2009, 12:40:04 AM »
Too tired to look at this tonight but trans3 has an error.
Code: [Select]
(mapcar '(lambda(x) (mapcar 'vlax-variant-value x)) rsdata)This does nothing with the variant value.

ZZZzzzz....


Thanks for that... Copied straight from the command window and did not set a variable!
I'll see if I can update the post above.

Edit: Ok, I updated the attachment above. Doesn't really change the timings, just the return value.
« Last Edit: April 03, 2009, 12:45:06 AM by gskelly »
Bricscad v12

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8690
  • AKA Daniel
Re: Wow... it sure does matter how you do it
« Reply #5 on: April 03, 2009, 01:57:42 AM »
Are you doing comparisons between AutoCAD and Bricscad?  Just wondering because I rand a few quick benchmark tests a while back, sending data between Arx/Brx and Lisp and to my surprise Bricscad was over twice as fast.

Quote
;AutoCAD  7.672 seconds
;Bricscad   2.186 seconds

(repeat 100000
    (speedtest "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 1 1.0)
  )

; AutoCAD 36.843
; Bricscad 9.422

(repeat 500000
    (speedtest "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 1 1.0)
)

IMHO the reason is, Autolisp from Autodesk is in maintenance mode and the other is not

Sorry to hijack your thread  :evil:
« Last Edit: April 03, 2009, 02:06:27 AM by Daniel »

gskelly

  • Newt
  • Posts: 185
Re: Wow... it sure does matter how you do it
« Reply #6 on: April 03, 2009, 07:48:48 AM »
Are you doing comparisons between AutoCAD and Bricscad?  Just wondering because I rand a few quick benchmark tests a while back, sending data between Arx/Brx and Lisp and to my surprise Bricscad was over twice as fast.

Dan, yes I am using Bricscad but I do not have Autocad therefore cannot do a direct comparison. The other machine with Autocad is "similar" (there are so many potential differences in OS and AV) so I would not call this a comparison. It seemed the timings for identical number of loops was sooo different I thought there might be something I am doing wrong...

On a different note: If I were to pack the data into a list and return it to Lisp similar to the demos you sent me would you expect that to be faster?

Greg
Bricscad v12

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Wow... it sure does matter how you do it
« Reply #7 on: April 03, 2009, 09:11:39 AM »
Using ACAD2000  8-)
Code: [Select]
==============================================================
 Testing transpose with vlax-variant-value: many cols few rows
Elapsed milliseconds / relative speed for 64 iteration(s):====Benchmarking
.........

    (TRANS3 DATA)......1292 / 22.76 <fastest>
    (TRANS1 DATA).....28121 / 1.05
    (TRANS2 DATA).....29402 / 1.00 <slowest>

==============================================================
 Testing transpose with vlax-variant-value: many rows few cols
Elapsed milliseconds / relative speed for 64 iteration(s):====Benchmarking
.........

    (TRANS1 DATA).....1512 / 1.27 <fastest>
    (TRANS2 DATA).....1512 / 1.27
    (TRANS3 DATA).....1922 / 1.00 <slowest>
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.

gskelly

  • Newt
  • Posts: 185
Re: Wow... it sure does matter how you do it
« Reply #8 on: April 03, 2009, 12:37:50 PM »
Bricscad v12