Author Topic: Looking for feedback: Looking through the viewport  (Read 2219 times)

0 Members and 1 Guest are viewing this topic.

Jeff H

  • Needs a day job
  • Posts: 6077
Re: Looking for feedback: Looking through the viewport
« Reply #15 on: January 17, 2013, 11:58:47 AM »
Also that will grab nested references if that is wanted, always can check OwnerId if needed.

TheMaster

  • Guest
Re: Looking for feedback: Looking through the viewport
« Reply #16 on: January 18, 2013, 10:12:40 AM »

From these results here, I think that AutoCAD must be doing a lot of calculating when the BTR method is first called that is stored for later use when it is called the second time.


Actually there's a very simple explaination for the slower times on the first test. When you run code the first time in an AutoCAD session, the code must be just-in-time compiled, which happens on a method-by-method basis, at the point just before the method executes for the first time. That, and quite possibly caching of the data in memory and/or disk caches would fully explain that.

You should take a look here for more recent posts of mine showing revised versions of GetObjects<T>() because the one's you're using are very slow, due to the use of the ObjectId.GetObject() method, verses using a transaction.

« Last Edit: January 18, 2013, 06:37:34 PM by TT »

WILL HATCH

  • Bull Frog
  • Posts: 448
Re: Looking for feedback: Looking through the viewport
« Reply #17 on: January 21, 2013, 10:20:13 AM »
Thank you guys! You'll have me updated into the 21st century before long...  It's funny, in school people talked about C++ being easier than assembly because they didn't like tracking registers, bits, etc. but here in .net which is quite "easy" to get started there are so many invisible details that it is really easy to make much bigger mistakes than forgetting to restore a register.

Cheers!

Will