poor performance
The purpose of this project was to create something managed like Java/C# but faster. Short anwser : it's slower.
How could C++ be slower than Java? This prompted me to do some performance tests, and generally C++ code is slower than Java. Only C code was faster.
For this simple example, C/C++ code is slightly faster:
for(int x=0;x<1024;x++) {
for(int y=0;y<1024;y++) {
for(int z=0;z<1024;z++) {
r += x * y + z;
}
}
}
But when I did more object oriented code, Java was faster:
ArrayList<String> al = new ArrayList<String>();
for(int x=0;x<1024*32;x++) {
al.add(new String("--"));
int cnt = al.size();
for(int y=0;y<cnt;y++) {
String e = al.get(y);
if (e.equals("test")) {
System.out.println("ok");
}
}
}
Even when I did a simple test with std C++ objects with highest optimization, it was slower than Java. When I replaced std objects with simple defined objects and even wrote a simple string compare function instead of the C strcmp() function, only then did the C++ code out perform Java.
After trying to get rid of shared_ptr and create a garbage collector the performance is still very bad.
Ok, this issue is finally resolved. Q# now offers manual memory management or the Boehm-Demers-Weiser garbage collector.
Performance is still an issue.
@pquiring this project is Just the birth begin soon ,the Performance is not the point