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

0 Members and 1 Guest are viewing this topic.

#### d2010

• Bull Frog
• Posts: 326
##### --={ Challenge }=-- Anyone can compare the speed of stack of call of defun?
« on: March 19, 2023, 01:35:27 AM »
:idea:Hello.
We need the compare and calculate the speeds of Stack for recursive-functions?
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?

« Last Edit: March 21, 2023, 04:43:55 AM by d2010 »

#### It's Alive!

• Retired
• Needs a day job
• Posts: 8788
• AKA Daniel
##### Re: --={ Challenge }=-- Anyone can compare the speed of stack of call of defun?
« Reply #1 on: March 19, 2023, 02:44:14 AM »
I test most all of them in C++

this is iterating entities in model space

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
##### Re: --={ Challenge }=-- Anyone can compare the speed of stack of call of defun?
« Reply #2 on: March 24, 2023, 09:05:13 AM »
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: 12925
• London, England
##### Re: --={ Challenge }=-- Anyone can compare the speed of stack of call of defun?
« Reply #3 on: March 24, 2023, 01:39:06 PM »
get-internal-real-time & format are not functions defined in the AutoLISP API.

#### kdub_nz

• Mesozoic keyThumper
• SuperMod
• Water Moccasin
• Posts: 2149
• class keyThumper<T>:ILazy<T>
##### Re: --={ Challenge }=-- Anyone can compare the speed of stack of call of defun?
« Reply #4 on: March 24, 2023, 03:30:01 PM »
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

---