Author Topic: getstring with getpoint?  (Read 4942 times)

0 Members and 1 Guest are viewing this topic.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: getstring with getpoint?
« Reply #15 on: June 12, 2013, 09:58:46 AM »
I would still like to see the benchmark comparison for BricsCad though. IMO that might be a lot faster.

And for those thinking this is just for input. Consider reading from a CSV file several 1000 points, you want as little to hangup the system as possible.

An interesting lesson to be learned: if you have subroutines for your subroutines, within a program, do not define them within the subroutine, but rather define them within the main program.
To a point. The issue is that you then end up either having to pass all variables as arguments, in which case you'd be losing some efficiency (passing arguments has an extra overhead over just using global variables). Or you need to ensure no variable name clashes due to the dynamic scoping. Performance-wise it makes sense yes, but it could cause bugs if you're not careful.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: getstring with getpoint?
« Reply #16 on: June 12, 2013, 10:06:57 AM »
I would still like to see the benchmark comparison for BricsCad though. IMO that might be a lot faster.

And for those thinking this is just for input. Consider reading from a CSV file several 1000 points, you want as little to hangup the system as possible.

An interesting lesson to be learned: if you have subroutines for your subroutines, within a program, do not define them within the subroutine, but rather define them within the main program.
To a point. The issue is that you then end up either having to pass all variables as arguments, in which case you'd be losing some efficiency (passing arguments has an extra overhead over just using global variables). Or you need to ensure no variable name clashes due to the dynamic scoping. Performance-wise it makes sense yes, but it could cause bugs if you're not careful.
Fair point. I didn't really mean using subroutines that called out to variables that are defined elsewhere.
eg.
(defun foo (x) (rtos x var1 var2))
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: getstring with getpoint?
« Reply #17 on: June 12, 2013, 10:18:20 AM »
Hum, a bit surprised by that.

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.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: getstring with getpoint?
« Reply #18 on: June 12, 2013, 12:02:47 PM »
I would still like to see the benchmark comparison for BricsCad though. IMO that might be a lot faster.
Further analysis shows that the mode argument is disregarded by BricsCAD's (distof) implementation. Comparing the txt2num_* functions therefore does not make a lot of sense.
But BricsCAD's (distof) is fast (even on a, not so fast, 7-year old laptop):
Code: [Select]
(setq str "25648645413219876846521684.584974654987")
(KGX_BenchMark '((distof str)) 65536)

; Benchmarking .......... elapsed milliseconds / relative timing <65536 iterations>

;   (DISTOF STR) ..... 171 / 1.00 <fastest> <slowest>