abraxus Posted October 16, 2013 Share Posted October 16, 2013 I was interested to know what is faster at processing Autocad entities (things like deleting objects, comparing objects, writing to an external database) I realize my question is not quite clearly defined, but I thought someone here might know based on experience - i have only worked with lisp and vba in autocad (i have .NET experience, but not in Autocad) I assume it works like this LISP (kinda-fast) VBA (fast) ObjectARC (faster) .NET (fastest) is that fairly accurate? Quote Link to comment Share on other sites More sharing options...
SEANT Posted October 17, 2013 Share Posted October 17, 2013 I think there are mixed reviews regarding the relative speed of VBA and Lisp. Coding method play a large part; For instance an AutoLisp entity creation via Command (slower) call versus Entmake (faster) straddles the speed of a VBA Object.AddEntity. I think one undisputed statement, though - ObjectARX is the speed king. I would definitely recommend investigating the ManagedARX API, if you have prior experience with one of the languages. DotNet produces speedier code, as well as offering a much more extensive tool set. Developing the code for any specific task tends to be more time consuming, but the end result makes the effort worthwhile. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted October 17, 2013 Share Posted October 17, 2013 1+... Well said! Here's a series of DevBlog articles, by a now former ADN Team member, that seem relevant: The Right Tools for the Job – AutoCAD Part 1 The Right Tools for the Job – AutoCAD Part 2 The Right Tools for the Job – AutoCAD Part 3 The Right Tools for the Job – AutoCAD Part 4 ... Here's an excerpt from Part 3: ... Enough details, let’s look at some data. As I mentioned, there were three data storage categories that I ran my tests on: Creating a Dictionary entry and storing an XRecord to it Creating a Dictionary entry and and storing a Custom Object to it Creating a Dictionary entry and storing XData to it I created sample code for each language and ran them for 1 million cycles (performing the same operation 1 million times) with a timer routine which timed the whole process. You’ll notice in the above slide that I have missed out the VB6/VBA (Out of Process) results – this is because they are *so* much slower than ObjectARX, .NET, VBA (In process) and LISP that if I were to apply the data to this slide you wouldn’t even see ObjectARX or .NET data showing up on the scale! Check out why VBA developers needed to migrate their applications to VB.NET using COM Interop if they want to run on 64bit! Of course, all of my tests showed that ObjectARX was significantly faster than all the other languages, no surprise there. That said, you can now clearly see why I don’t use Transactions in any of my sample code, it’s slower than Open/Close for both .NET and ObjectARX. I’ll dig into why this is in a later post. What I found really surprising, is how well VBA (In Process 32bit) and LISP performed. Yes, .NET is about 5 times faster for this specific test benchmark, but considering that the time is only 75-80 seconds for 1,000,000 records, that’s pretty impressive. Looking into why this is happening, I can see that the reason is that most of the work is actually done under the hood by AutoCAD (C++ code), reinforcing my earlier point that it really depends on what you are doing whether you see dramatic (or not) resulting time differences. The specific Xdata test I ran though, in my opinion, is not really a good real life benchmark because generally speaking Xdata will not be attached to a Dictionary entry that we just created. So I decided to run a pure test against attaching Xdata to an existing object. Surprisingly in my tests, attaching Xdata to an existing entity only gave slightly better results for .NET and ObjectARX 8 seconds instead of 9 for ObjectARX and 14 seconds instead of 15. ... Cheers Quote Link to comment Share on other sites More sharing options...
abraxus Posted October 17, 2013 Author Share Posted October 17, 2013 excellent post... since i know nothing about objectARX, where do you people suggest i start learning? i assume it is at least similar to VBA and lets you draw forms and add actions to buttons and such, right? Quote Link to comment Share on other sites More sharing options...
Debalance Posted November 11, 2013 Share Posted November 11, 2013 I would suggest that you start your learning with the basics of C++. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.