Click here to Skip to main content
15,929,980 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to optimize this code ? Pin
Guffa29-Sep-07 0:02
Guffa29-Sep-07 0:02 
GeneralRe: How to optimize this code ? Pin
svincoll429-Sep-07 0:04
svincoll429-Sep-07 0:04 
GeneralRe: How to optimize this code ? Pin
Guffa29-Sep-07 5:19
Guffa29-Sep-07 5:19 
svincoll4 wrote:
oh no, why do you think that? i fail.


Oh, sorry. Because it's not that uncommon that people try things like that, and you didn't speak of the test in the past tense.

svincoll4 wrote:
but i want to know how to optimize it?


Well, that depends on the language used, and what the rest of the code looks like.

You could perhaps use a pointer to clear the array faster. Loop unraveling is another optimising method that would simply replace the loop with 101 assignment statements.

However, the most efficient might be if the code that is going to use the array could be altered to not needing the array to be cleared at all, then the loop could simply be removed.

If it's a newly created array, it might not need clearing at all. Some languages automatically clears new arrays on creation, so clearing it again would be completely pointless.

---
single minded; short sighted; long gone;

GeneralRe: How to optimize this code ? Pin
Paul Conrad29-Sep-07 7:02
professionalPaul Conrad29-Sep-07 7:02 
GeneralRe: How to optimize this code ? Pin
Paul Conrad29-Sep-07 7:01
professionalPaul Conrad29-Sep-07 7:01 
GeneralRe: How to optimize this code ? Pin
Malcolm Smart29-Sep-07 7:18
Malcolm Smart29-Sep-07 7:18 
GeneralRe: How to optimize this code ? Pin
PIEBALDconsult29-Sep-07 14:28
mvePIEBALDconsult29-Sep-07 14:28 
GeneralRe: How to optimize this code ? Pin
Patrick Etc.30-Sep-07 5:22
Patrick Etc.30-Sep-07 5:22 
AnswerRe: How to optimize this code ? Pin
svincoll429-Sep-07 22:17
svincoll429-Sep-07 22:17 
AnswerRe: How to optimize this code ? Pin
PIEBALDconsult29-Sep-07 4:35
mvePIEBALDconsult29-Sep-07 4:35 
GeneralRe: How to optimize this code ? Pin
Paul Conrad29-Sep-07 7:04
professionalPaul Conrad29-Sep-07 7:04 
AnswerRe: How to optimize this code ? Pin
Luc Pattyn29-Sep-07 8:01
sitebuilderLuc Pattyn29-Sep-07 8:01 
QuestionVideo Transmission using Windows Media Services Pin
DeepOceans28-Sep-07 23:04
DeepOceans28-Sep-07 23:04 
QuestionVisio automation via C# Pin
Menhal28-Sep-07 22:49
Menhal28-Sep-07 22:49 
AnswerRe: Visio automation via C# Pin
Abisodun1-Oct-07 1:38
Abisodun1-Oct-07 1:38 
Questionto validate date Pin
P_Elza28-Sep-07 22:23
P_Elza28-Sep-07 22:23 
AnswerRe: to validate date Pin
DaveyM6928-Sep-07 23:44
professionalDaveyM6928-Sep-07 23:44 
GeneralRe: to validate date Pin
Luc Pattyn29-Sep-07 0:36
sitebuilderLuc Pattyn29-Sep-07 0:36 
GeneralRe: to validate date Pin
DaveyM6929-Sep-07 0:45
professionalDaveyM6929-Sep-07 0:45 
QuestionDifference Pin
John.L.Ponratnam28-Sep-07 21:51
John.L.Ponratnam28-Sep-07 21:51 
AnswerRe: Difference Pin
P_Elza28-Sep-07 22:14
P_Elza28-Sep-07 22:14 
QuestionCheckBoxes problem! Pin
XFighter28-Sep-07 21:29
XFighter28-Sep-07 21:29 
QuestionGeneric XL upload with validation Pin
subbu.sk28-Sep-07 21:14
subbu.sk28-Sep-07 21:14 
Questionhow to spilit html tags and string using c# code(very urgent) Pin
Revathi Raj28-Sep-07 20:32
Revathi Raj28-Sep-07 20:32 
AnswerRe: how to spilit html tags and string using c# code(very urgent) Pin
Paul Conrad29-Sep-07 6:56
professionalPaul Conrad29-Sep-07 6:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.