Author Topic: Another race!! (How fast can you change an entity/object)  (Read 9467 times)

0 Members and 1 Guest are viewing this topic.

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9227
Another race!! (How fast can you change an entity/object)
« Reply #15 on: October 02, 2003, 12:51:48 PM »
damn this is fun.
“Common sense is not so common.” ~Voltaire

--> Donate to TheSwamp.org <--

daron

  • Guest
Another race!! (How fast can you change an entity/object)
« Reply #16 on: October 02, 2003, 12:58:31 PM »
That is fast, Stig. Thank you all for helping me to figure out those foreach and mapcar subs. I've got some old routines that could definately use an overhaul based on these tests.

SMadsen

  • Guest
Another race!! (How fast can you change an entity/object)
« Reply #17 on: October 02, 2003, 01:01:55 PM »
Actually I think it's the chunk of code between each run that counts, not the actually looping. Try doing some list handling to run through the list instead of counting through it:

Code: [Select]
(defun repeat_it (lst / cnt)
  (setq cnt 0)
  (startTimer)
  (repeat (length lst)
    (expt (car lst) 2.0)
    (setq lst (cdr lst))
  )
  (endTimer "repeat_it")
)


(repeat_it alist)
Timed repeat_it: 0.094025

A quite noticable change!

SMadsen

  • Guest
Another race!! (How fast can you change an entity/object)
« Reply #18 on: October 02, 2003, 01:04:54 PM »
Code: [Select]
(defun while_it (lst)
  (startTimer)
  (while lst
    (expt (car lst) 2.0)
    (setq lst (cdr lst))
  )
  (endTimer "while_it")
)


(while_it alist)
Timed while_it: 0.078012

Oh well, gotta learn while living... :)

daron

  • Guest
Another race!! (How fast can you change an entity/object)
« Reply #19 on: October 02, 2003, 01:08:31 PM »
Quote from: SMadsen
Oh well, gotta learn while living... :)


Now ain't that the truth.

rugaroo

  • Bull Frog
  • Posts: 378
  • The Other CAD Guy
Another race!! (How fast can you change an entity/object)
« Reply #20 on: October 02, 2003, 02:47:38 PM »
I wish I worked with you guys....I am sitting here regrading a five acre parcel, while you are all racing around trying to see who can do something quicker....all well...At least I know what I am doing rather than sittin here trying to compete...I would have the only prog that takes over 5 minutes. lol
LDD06-09 | C3D 04-19 | Infraworks 360 | VS2012-VS2017