2005/5/10

     
 

Performance

artefaktur

| ACDK Types | Constructs | Metainfo | DMI | Memory | Performance |

There are several regards of performance of ACDK program.


Content of this chapter:

   Introduction
     Layers
   Threading
   Implementation Technics
     Use Stack instances
     Use References
     String optimation
     Inline functions


 Introduction

ACDK is designed to provide many features, which makes development more easy. Some of this features also costs performance.
This chapters should help you to implement fast ACDK programs.

 Layers

A distributed ACDK application should organized in following layers:
  • External Interfaces for distributed computing and scripting.
    These interfaces are normally connected with the most overhead.
  • Internal Interfaces for meta features like serialization, memory management.
  • Internal Implementation.


 Threading

Avoid using acdk::util::Vector and acdk::util::Hashtable. The classes acdk::util::ArrayList and acdk::util::HashMap has the same functionality but are internally not synchronized. If the Container instances are only used in one thread, synchronization is not neccessary, but has nagative impact on the performance.

 Implementation Technics

 Use Stack instances

In ACDK you can allocate the variable not only via new operator (like in Java and C#) but also allocate the objects on the stack.

Please refert to  Stack.

 Use References

ACDK base mechanism to make garbage collection is using reference counting.
To safe unneeded reference counts, you may use stack variable if appropriate (see  Stack).

Another issue is passing object variables to functions:

void foo(RString str) 
{
  
}
RString s = "asdf";
foo(s); // do increment and decrement the reference count

If you use the IN() argument attribute the passed reference doesn't do increment/decrement reference count:

void foo(IN(RString) str) 
{
  
}
RString s = "asdf";
foo(s); // do NOT increment and decrement the reference count

 String optimation

Please refer to  Stack and  String to improve string performance.

 Inline functions

Different to Java or C# in ACDK you can use explicetally inline methods. The inlined methods are of course usefull if you have very short methods.


 < prevLanguage(6 / 6)