ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Object ARx classic (C++) vs. .NET

3 REPLIES 3
Reply
Message 1 of 4
RichardErnstberger
843 Views, 3 Replies

Object ARx classic (C++) vs. .NET

Hello all,
i'm in the stage of creating a new ARx project and considering the switch from the classic ARx to .NET.
From some talks to other programmers i'm confused about performance issues. Some say there's no real performance difference, some other stated that performance is cut to less than 50% of a classic ARx app.
So i'm asking for some other statements, reports or experiences about performace in current projects using .NET....
The app should run with AutoCAD 2011 and later, DWG sizes can grow up to 25 megabytes.
Thanks in advance for any help,
Richard
3 REPLIES 3
Message 2 of 4

It all depends upon what you are trying to do. In many cases ObjectARX is just a tiny bit faster then ObjectARX (where the .NET function is a thin wrapper of the ObjectARX function), in some cases ObjectARX is a lot faster then .NET (where the .NET function may be a refactored version of an ObjectARX capability making it easier to use/manage) - and there are also a few cases where .NET is faster then ObjectARX. If speed is important, it is less about ObjectARX versus .NET and more about how yoiu use ObjectARX and .NET. Both can be fast and both can be slow. You would need to provide a lot more detail on what you are trying to accomplish in order to get good advice on what to watch for to get best performance.

Best wishes!
Jim Quanci
Autodesk
Message 3 of 4
Anonymous
in reply to: RichardErnstberger

One example can be if you want to develop for MEP - the .NET route it is the
right one.

Try that from ATL COM side, no way. 🙂


//--

It all depends upon what you are trying to do. In many cases ObjectARX is
just a tiny bit faster then ObjectARX (where the .NET function is a thin
wrapper of the ObjectARX function), in some cases ObjectARX is a lot faster
then .NET (where the .NET function may be a refactored version of an
ObjectARX capability making it easier to use/manage) - and there are also a
few cases where .NET is faster then ObjectARX. If speed is important, it is
less about ObjectARX versus .NET and more about how yoiu use ObjectARX and
.NET. Both can be fast and both can be slow. You would need to provide a
lot more detail on what you are trying to accomplish in order to get good
advice on what to watch for to get best performance.

Best wishes!
Jim Quanci
Autodesk
Message 4 of 4
Anonymous
in reply to: RichardErnstberger

{quote}

Some say there's no real performance difference, some other stated that
performance is cut to less than 50% of a classic ARx app.

{quote}

Those are over-generalizations that really aren't applicable without taking into
consideration individual applications, and I would venture to guess that it is
usually somewhere between the two.

For managed code that does little more than use the managed wrappers, there
isn't really that much difference because the managed wrappers are just
delegating to the native classes, and use the same APIs that the equivalent
native code would use.

There are some issues relating to things like for example, the Overrule classes,
which require a native-to-managed thunk for every overrridable virtual method on
the managed wrapper (that could have been avoided, but sadly it wasn't), and
there are cases where managed wrappers must do things in managed code, rather
than delegate to native code.

In short, it really depends on what each app does, and how much of what it does
amounts to simply delegating to native code, the amount of native-to-managed
thunking involved, and many other variables, so we really can't generalize about
that.

In some cases I suppose there conceivably can be a 50% or greater performance
hit, but in others it could be minimal. In the larger picture, that must be
weighed against the advantages of .NET (easier UI development, access to all of
the .NET managed runtime, etc.).

If you want to have your cake and eat it to, you can use C++/CLI to build
mixed-mode assemblies that contain both native and managed code, using whichever
is better suited for each individual need, on a case-by-case basis.

In a mixed mode assembly, you can write native code that calls into managed
code, and visa versa, and C++/CLI makes the use of native C++ classes from
managed code almost completely transparent and brain-dead easy (which is why
it's called 'IJW' or "It Just Works").

Many of the apps I build have both pure-managed and mixed-mode native/managed
components, and that constitutes the best of both worlds. If there is something
in
particular that takes too long in managed code, I can easily implement it in
native
code, and then consume it from managed code.

Mixed-mode C++/CLI is what Autodesk uses for developing the managed API,
and probably for other things as well. There are a few downsides to C++/CLI
however. It's more complicated than C# (e.g., the C++ compiler doesn't allow
cyclical references like C#'s compiler does); C++/CLI doesn't support things
like
LINQ, lambdas, calling extension methods (which is just sugar), and of course,
mixed-mode assemblies cannot be platform-agnostic as purely-managed dlls can.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message
news:6336508@discussion.autodesk.com...
Hello all,
i'm in the stage of creating a new ARx project and considering the switch from
the classic ARx to .NET.
From some talks to other programmers i'm confused about performance issues. Some
say there's no real performance difference, some other stated that performance
is cut to less than 50% of a classic ARx app.
So i'm asking for some other statements, reports or experiences about performace
in current projects using .NET....
The app should run with AutoCAD 2011 and later, DWG sizes can grow up to 25
megabytes.
Thanks in advance for any help,
Richard

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost