Click here to Skip to main content
15,917,176 members
Home / Discussions / C#
   

C#

 
GeneralRe: Visual studio 2010 C# identity without hyphen Pin
Eddy Vluggen17-Feb-15 12:00
professionalEddy Vluggen17-Feb-15 12:00 
AnswerRe: Visual studio 2010 C# identity without hyphen Pin
#realJSOP18-Feb-15 6:24
professional#realJSOP18-Feb-15 6:24 
GeneralRe: Visual studio 2010 C# identity without hyphen Pin
sdfsdfsdfewrew3feff20-Feb-15 6:05
sdfsdfsdfewrew3feff20-Feb-15 6:05 
GeneralRe: Visual studio 2010 C# identity without hyphen Pin
#realJSOP21-Feb-15 2:25
professional#realJSOP21-Feb-15 2:25 
GeneralRe: Visual studio 2010 C# identity without hyphen Pin
sdfsdfsdfewrew3feff23-Feb-15 2:09
sdfsdfsdfewrew3feff23-Feb-15 2:09 
GeneralRe: Visual studio 2010 C# identity without hyphen Pin
sdfsdfsdfewrew3feff1-Mar-15 5:10
sdfsdfsdfewrew3feff1-Mar-15 5:10 
QuestionConverting Alphabet to corresponding number Pin
Tetra104416-Feb-15 5:27
Tetra104416-Feb-15 5:27 
AnswerRe: Converting Alphabet to corresponding number Pin
Rob Philpott16-Feb-15 5:33
Rob Philpott16-Feb-15 5:33 
GeneralRe: Converting Alphabet to corresponding number Pin
Tetra104416-Feb-15 6:10
Tetra104416-Feb-15 6:10 
SuggestionRe: Converting Alphabet to corresponding number Pin
Richard Deeming16-Feb-15 8:29
mveRichard Deeming16-Feb-15 8:29 
GeneralRe: Converting Alphabet to corresponding number Pin
Rob Philpott16-Feb-15 9:28
Rob Philpott16-Feb-15 9:28 
GeneralRe: Converting Alphabet to corresponding number Pin
Wastedtalent19-Feb-15 4:55
professionalWastedtalent19-Feb-15 4:55 
AnswerRe: Converting Alphabet to corresponding number Pin
PIEBALDconsult16-Feb-15 5:47
mvePIEBALDconsult16-Feb-15 5:47 
GeneralRe: Converting Alphabet to corresponding number Pin
Tetra104416-Feb-15 6:12
Tetra104416-Feb-15 6:12 
AnswerRe: Converting Alphabet to corresponding number Pin
BillWoodruff16-Feb-15 12:59
professionalBillWoodruff16-Feb-15 12:59 
GeneralRe: Converting Alphabet to corresponding number Pin
Rob Philpott16-Feb-15 23:21
Rob Philpott16-Feb-15 23:21 
QuestionWhy is Array.Sort() slower if I use my own comparer? Pin
robinsc16-Feb-15 1:09
robinsc16-Feb-15 1:09 
AnswerRe: Why is Array.Sort() slower if I use my own comparer? Pin
Rob Philpott16-Feb-15 2:06
Rob Philpott16-Feb-15 2:06 
GeneralRe: Why is Array.Sort() slower if I use my own comparer? Pin
robinsc16-Feb-15 2:20
robinsc16-Feb-15 2:20 
GeneralRe: Why is Array.Sort() slower if I use my own comparer? Pin
Rob Philpott16-Feb-15 2:26
Rob Philpott16-Feb-15 2:26 
GeneralRe: Why is Array.Sort() slower if I use my own comparer? Pin
robinsc16-Feb-15 2:35
robinsc16-Feb-15 2:35 
SuggestionRe: Why is Array.Sort() slower if I use my own comparer? Pin
Richard Deeming16-Feb-15 8:20
mveRichard Deeming16-Feb-15 8:20 
GeneralRe: Why is Array.Sort() slower if I use my own comparer? Pin
Rob Philpott16-Feb-15 8:22
Rob Philpott16-Feb-15 8:22 
GeneralRe: Why is Array.Sort() slower if I use my own comparer? Pin
robinsc16-Feb-15 21:57
robinsc16-Feb-15 21:57 
In the end I found the source code of the c++ quicksort implementation in clr and it's really very similar to the quicksort algorithm I used in c# (see node below).
So I guess one should switch to c++ if it comes to sorting big structs as well and the average performance difference between c# and c++ of a few percenant points does not hold for this kind of operations. For everybody who tries to find the answer to the same question, here is the code they use:

static void QuickSort(KIND keys[], KIND items[], int left, int right) {
WRAPPER_CONTRACT;

// Make sure left != right in your own code.
_ASSERTE(keys != NULL && left < right);
do {
int i = left;
int j = right;
KIND x = keys[i + ((j - i) >> 1)];
do {
while (keys[i] < x) i++;
while (x < keys[j]) j--;
_ASSERTE(i>=left && j<=right);
if (i > j) break;
if (i < j) {
KIND key = keys[i];
keys[i] = keys[j];
keys[j] = key;
if (items != NULL) {
KIND item = items[i];
items[i] = items[j];
items[j] = item;
}
}
i++;
j--;
} while (i <= j);
if (j - left <= right - i) {
if (left < j) QuickSort(keys, items, left, j);
left = i;
}
else {
if (i < right) QuickSort(keys, items, i, right);
right = j;
}
} while (left < right);
}
AnswerRe: Why is Array.Sort() slower if I use my own comparer? Pin
Dave Kreskowiak16-Feb-15 2:56
mveDave Kreskowiak16-Feb-15 2: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.