Показать сообщение отдельно
Старый 08.01.2008, 16:30   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
axStart: don't extend AX foundation classes, you lose performance
Источник: http://axstart.spaces.live.com/Blog/...C0A0!222.entry
==============


I received a quite interesting test from an AX partner in the Netherlands (TOINCREASE).
They did a resurge about the performance with AX foundation classes. They want to know if it is better to extend from the foundation classes or simply use them the way they are.
 
Advantages of using kernel classes
Those classes are fast and easy to use. And if you need extra functionality this is based on the kernel class. For example: if you need extra functionality for a struct (to copy), then this usable for all the structs.
 
Advantages of using kernel extended classes
All the specific methods can be added to the kernel class. So it’s easier to access those methods. Maintainability is better and object oriented.
 
Test Results:
Option
List
Map
Struct
Extended class with overwriting standard methods
Extended class without overwriting standard
Speed to add and read 10.000 items
0,27 s
0,40 s
0,41 s
0,87 s
0,48 s
Run time in Percentage
100%
148%
151%
322%
177%
Possibility to read based on adding sequence
X
 
X
X
X
Can be read in alphabetical order
 
X
 
X
 
Has a index property
 
 
X
X
X
Can remove based on key
 
X
X
X
X
Can find item based on key
 
X
X
X
X
Can find item based on index
 
 
X
X
X
Can have multiple types in one field
 
 
 
 
 
Can contain extra methods
 
 
 
X
X
 
conclusions:
1)   Never extend base classes like struct, map, list etc. By extending the base class the performance will slow down by a factor 2 or 3!
2)    Struct and map are both running on almost the same speed! This is not the big difference as everybody thought!
3)    Extending a class slows down the process! Also if you do not overwrite any method!

Источник: http://axstart.spaces.live.com/Blog/...C0A0!222.entry
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.