From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e19b5ae33edaea7c X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 19 Sep 2005 19:26:45 -0500 From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: puzzled re hyperthreaded performance References: <5bd67$432f1da8$3ea6010b$8314@news.versatel.net> X-Newsreader: Tom's custom newsreader Message-ID: <-amdnSVxPY7YyrLeRVn-jA@comcast.com> Date: Mon, 19 Sep 2005 19:26:45 -0500 NNTP-Posting-Host: 24.6.102.223 X-Trace: sv3-PIpIPSrjnM5a9Dz3b6seei+Bo83KKqnvqk/wkc/M8zJVEvUVbPMX95/iNOhy+SctMYEKfdaTPD+UgKG!Wsue0NNhIAbARTPdJZC7eXkG6DiJ0UouHcU8b96F2MiAZpyPTw3F+AwT41Lax6jqcB2Xpncuvks/ X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net 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.32 Xref: g2news1.google.com comp.lang.ada:4927 Date: 2005-09-19T19:26:45-05:00 List-Id: > I think the hypertreading is more like multiplexing the cpu over different > threads without the > cost of taskswitching but t does not give you additional CPU performance. > This effect can make measurements very confusing. > > I whould like to know if anyone has a different experience. Running a sort on 100K floats (so about 400K bytes) I find a substantial speedup (about 30%) if it's split into two simultaneous tasks, the main program and an Ada task. Using Ada.Containers.Hashed_Maps to find all the n-character strings in a given 50K string of just 4 letters (simulated DNA) with the main program doing it for n=12 and the extra Ada task for n=18, there is no improvement, and in fact a loss. But the same program run with n=6 and n=8 does show significant speedup. In the former case, there are roughly 50K strings of the indicated sizes, so the hash table presumably has about 50000*18 bytes of key data or roughly 1MB, so the second task, which needs another 1MB hash table, is probably fighting over the processor's total 1MB cache space, while in the latter case there is probably room for both in cache. If I switch to Ada.Containers.Indefinite_Hashed_Maps, then even the small one shows no multitasking speedup. I haven't analyzed Indefinite_Hashed_Maps to see why that might be the case. Running a word counting program, there was a substantial speedup by processing alternate buffer loads via the environment task and a second task. In that case there was probably no cache contention, and one task was probably processing its bufferload while the other was doing IO (which probably did not come off disk except on the first run of the program). The above is on a hyperthreaded Pentium under Windows 2000. YMMV