Author Topic: --={ Challenge }=-- Anyone can compare the speed of stack of call of defun?  (Read 743 times)

0 Members and 1 Guest are viewing this topic.

d2010

  • Bull Frog
  • Posts: 323
 :idea:Hello.
We need the compare and calculate the speeds of Stack for recursive-functions?
<Must be in different platforms  BrisCad, AutoCad, Cadian, ProgeCad
Who is the winner?
How we can calculate the speed of Stack with LISP sources?
The stack-of-call/s inside VLX is more slower than .LSP?
The stack-of-call/s inside FAS is more slower than .VLX?
 :police:
« Last Edit: March 21, 2023, 04:43:55 AM by d2010 »

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8659
  • AKA Daniel
I test most all of them in C++

this is iterating entities in model space
AutoCAD is the fastest, followed by ZwCad

Quote
Num Entities = 291876
ARX - DbTests::OpenAllForRead, Time = 0.031310
ARX - DbTests::OpenAllForRead, Time = 0.029678
ARX - DbTests::OpenAllForRead, Time = 0.029503
ARX - DbTests::OpenAllForRead, Time = 0.030294

BRX - DbTests::OpenAllForRead, Time = 0.084655
BRX - DbTests::OpenAllForRead, Time = 0.083957
BRX - DbTests::OpenAllForRead, Time = 0.090532
BRX - DbTests::OpenAllForRead, Time = 0.085526

GRX - DbTests::OpenAllForRead, Time = 0.045137
GRX - DbTests::OpenAllForRead, Time = 0.045998
GRX - DbTests::OpenAllForRead, Time = 0.045715
GRX - DbTests::OpenAllForRead, Time = 0.046274

ZRX - DbTests::OpenAllForRead, Time = 0.041592
ZRX - DbTests::OpenAllForRead, Time = 0.042775
ZRX - DbTests::OpenAllForRead, Time = 0.040999
ZRX - DbTests::OpenAllForRead, Time = 0.042115

Num Entities = 291876
ARX - DbTests::OpenAllForWriteXform, Time = 0.709899
ARX - DbTests::OpenAllForWriteXform, Time = 0.712916
ARX - DbTests::OpenAllForWriteXform, Time = 0.710051
ARX - DbTests::OpenAllForWriteXform, Time = 0.713089

BRX - DbTests::OpenAllForWriteXform, Time = 1.374065
BRX - DbTests::OpenAllForWriteXform, Time = 1.375848
BRX - DbTests::OpenAllForWriteXform, Time = 1.338291
BRX - DbTests::OpenAllForWriteXform, Time = 1.355196

GRX - DbTests::OpenAllForWriteXform, Time = 1.447262
GRX - DbTests::OpenAllForWriteXform, Time = 1.461199
GRX - DbTests::OpenAllForWriteXform, Time = 1.489696
GRX - DbTests::OpenAllForWriteXform, Time = 1.518017

ZRX - DbTests::OpenAllForWriteXform, Time = 0.845144
ZRX - DbTests::OpenAllForWriteXform, Time = 0.842838
ZRX - DbTests::OpenAllForWriteXform, Time = 0.856382
ZRX - DbTests::OpenAllForWriteXform, Time = 0.846967

Chris8765

  • Mosquito
  • Posts: 1
To compare stack call speed across platforms like BricsCAD, AutoCAD, CADian and ProgeCAD, you need to create equivalent recursive functions on each platform and measure their execution time. This can be done by using the timer function to measure the time it takes to complete each function.
Code: [Select]
(defun test-speed ()
  (setq start-time (get-internal-real-time))
  ; code to test speed goes here
  (setq end-time (get-internal-real-time))
  (princ (format "Elapsed time: %f seconds" (- end-time start-time))))
In this example, the test-speed function can be used to measure the time taken by the code that you want to test. The get-internal-real-time function returns the current internal real time in seconds and the format function is used to print the elapsed time in seconds.

As for your other questions, the speed of stack calls inside VLX or FAS files may depend on various factors such as the size of the file, the algorithm used, and the specific implementation of the programming language. It's difficult to say which one is faster without further information.

Lee Mac

  • Seagull
  • Posts: 12905
  • London, England
get-internal-real-time & format are not functions defined in the AutoLISP API.

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2121
  • class keyThumper<T>:ILazy<T>
Those are Common Lisp functions.

When asking ChatGPT ( or blind google searches ) the question is important, and some interpretation may be required :)
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

BIGAL

  • Swamp Rat
  • Posts: 1396
  • 40 + years of using Autocad
ChatGP will be a nightmare for a while yet. So much incorrect code. Makes up function names when it does not know how to do it other posts have exposed this problem on lots of forums.
A man who never made a mistake never made anything