Click here to Skip to main content
15,920,633 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Everybody

I'm trying to improve my applicaction performance.

This part of code takes 16 milliseconds to execute in x64
C#
string[] arrayPosicionOrden = new string[1181];


           arrayPosicionOrden[0] =(char)(miOrden._Side.Length+32) + (miOrden._Side);
           arrayPosicionOrden[1] = (char)(miOrden._Quantity.Length + 32) + (miOrden._Quantity);
           arrayPosicionOrden[2] = (char)(miOrden._Modality.Length + 32) + (miOrden._Modality);
           arrayPosicionOrden[3] = (char)(miOrden._Price.Length + 32) + (miOrden._Price);
           arrayPosicionOrden[4] = (char)(miOrden._Validity.Length + 32) + (miOrden._Validity);
           arrayPosicionOrden[5] = (char)(miOrden._ExpiryDate.Length + 32) + (miOrden._ExpiryDate);
           arrayPosicionOrden[8] = (char)(miOrden._MinimumQuantity.Length + 32) + (miOrden._MinimumQuantity);
           arrayPosicionOrden[9] = (char)(miOrden._DisplayedQuantity.Length + 32) + (miOrden._DisplayedQuantity);
           arrayPosicionOrden[10] = (char)(miOrden._ClientReference1.Length + 32) + (miOrden._ClientReference1);
           arrayPosicionOrden[12] = (char)(miOrden._internalReference.Length + 32) + (miOrden._internalReference);
           arrayPosicionOrden[13] = (char)(miOrden._ExchangeNumber.Length + 32) + (miOrden._ExchangeNumber);
           arrayPosicionOrden[16] = (char)(miOrden._OrderType.Length + 32) + (miOrden._OrderType);
           arrayPosicionOrden[17] = (char)(miOrden._TypeOfCustomerAccount.Length + 32) + (miOrden._TypeOfCustomerAccount);
           arrayPosicionOrden[20] = (char)(miOrden._AllocatedMember2.Length + 32) + (miOrden._AllocatedMember2);
           arrayPosicionOrden[81] = (char)(miOrden._Memo.Length + 32) + (miOrden._Memo);
           arrayPosicionOrden[106] = (char)(miOrden._GLID.Length + 32) + (miOrden._GLID);
           arrayPosicionOrden[196] = (char)(miOrden._TriggeringParameter.Length + 32) + (miOrden._TriggeringParameter);
           arrayPosicionOrden[209] = (char)(miOrden._ValidityType.Length + 32) + (miOrden._ValidityType);


In x86 only takes 1 ms.

Is this normal or am I doing something wrong?

I´m using Windows 7 x64

Thanks
Posted
Updated 1-Jun-15 22:40pm
v2

1 solution

This is too little code/work to make a serious conclusion. Maybe the x64 code needed to wait for a processor to become available. To seriously test something like this you need to execute it at least a thousand upto a million times and maybe even more to get some serious results.

https://msdn.microsoft.com/en-us/library/ff647791.aspx[^]

Good luck!
 
Share this answer
 
Comments
g.jim 2-Jun-15 11:22am    
Thank you. I´m testing with thousands of iterations and maybe my logger causes these 16 ms

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900