NNTP-Posting-Date: Wed, 13 Jun 2012 20:25:45 -0500 Message-ID: <4FD93D9B.7012@mindspring.com> Date: Wed, 13 Jun 2012 21:25:47 -0400 From: pete Reply-To: pfiland@mindspring.com Organization: PF X-Mailer: Mozilla 3.04Gold (WinNT; I) MIME-Version: 1.0 Newsgroups: comp.lang.c Subject: Open letter to Ian Collins References: Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Lines: 109 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 4.154.219.149 X-Trace: sv3-4ccFJF+3MhyMV0TX0jhz99W2whny+axS59t6DPxdMneUxh0hQA2lxAjpUfrBclCAlfQEev51Hn5VcKU!mztWDqu9z3wOEcDhkyTi+2Xx2g1lPPtYoZfe7fl1vxJnGY6x56IKPx3JaTeLA89TYbGe62rDiVoU!56Lda/HHUh0= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 3924 Path: csiph.com!usenet.pasdenom.info!news.franciliens.net!feed.ac-versailles.fr!proxad.net!feeder1-2.proxad.net!74.125.178.16.MISMATCH!postnews.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail Xref: csiph.com comp.lang.c:22239 Ian Collins wrote: > > On 05/27/12 07:30 PM, jacob navia wrote: > > Le 27/05/12 05:16, Ian Collins a écrit : > >> On 05/27/12 10:22 AM, jacob navia wrote: > >>> Hi Ian > >>> > >>> In the c++ newsgroup you asked me > >>> for an example of the ccl performance > >>> It was something with building a huge list, then sorting it, if I > >>> remember correctly... > >>> > >>> I have built this example code: > >>> > >> > >> > >> I get a segv when I run the example. > >> Running in dbx with access checking > >> enabled shows: > > > > I corrected that yesterday. > > When you asked me gthis example I was in the > > middle of a reorganization of heap.c. Look at the latest update > > OK, > I thought I had but I didn't notice wget saving the file as cc.zip.1 > rather than overwriting the version I downloaded earlier in the week. > > Anyway I ran ran the code > built with Sun Studio rather than gcc because > it runs quite a bit faster. As I expected, the big difference was in > sorting: > > ccl version: > > To sort 85.6384S > > C++ version (std::list.sort()): > > To sort 18.7927S > > Iteration was closer: > > To access 2.80655S (ccl) > To access 1.82896S /* ** Would you please run this program ** and let me know what the output is? ** I'm of the opinion that the QSORT function ** which is currently in listgen.c, at ** http://code.google.com/p/ccl/downloads/detail?name=ccl.zip&can=2&q= ** has approximately zero chance of correctly sorting ** a data set of as many as 10000000 psuedorandom keys. */ #include #include "containers.h" #include "intlist.h" #define N 10000000 int main(void) { intList *L1; size_t i; int d; long unsigned sum=0,newSum=0; Iterator *it; int *pint, last_pint; L1 = iintList.Create(sizeof(int)); iintList.UseHeap(L1,NULL); // Use specialized Heap // Add N random numbers to the integer list for (i=0; iGetFirst(it); while (pint != NULL) { last_pint = *pint; newSum += last_pint; pint = it->GetNext(it); if (pint != NULL && last_pint > *pint) { puts("\n\nThe data is not sorted.\n\n"); iintList.Finalize(L1); exit(EXIT_SUCCESS); } } // Verify that both sums are identical if (sum != newSum) { printf("Failed\n"); } else { printf("Sum = %lu\n",sum); } // Destroy the list iintList.Finalize(L1); return 0; } -- pete