Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connections
Warning: mysqli::query(): Couldn't fetch mysqli in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\index.php on line 66
Article <v35qrg$qhnf$1@dont-email.me>
Deutsch   English   Français   Italiano  
<v35qrg$qhnf$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bart <bc@freeuk.com>
Newsgroups: comp.lang.c
Subject: Re: xxd -i vs DIY Was: C23 thoughts and opinions
Date: Wed, 29 May 2024 00:54:23 +0100
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <v35qrg$qhnf$1@dont-email.me>
References: <v2l828$18v7f$1@dont-email.me>
 <00297443-2fee-48d4-81a0-9ff6ae6481e4@gmail.com>
 <v2lji1$1bbcp$1@dont-email.me> <87msoh5uh6.fsf@nosuchdomain.example.com>
 <f08d2c9f-5c2e-495d-b0bd-3f71bd301432@gmail.com>
 <v2nbp4$1o9h6$1@dont-email.me> <v2ng4n$1p3o2$1@dont-email.me>
 <87y18047jk.fsf@nosuchdomain.example.com>
 <87msoe1xxo.fsf@nosuchdomain.example.com> <v2sh19$2rle2$2@dont-email.me>
 <87ikz11osy.fsf@nosuchdomain.example.com> <v2v59g$3cr0f$1@dont-email.me>
 <20240528144118.00002012@yahoo.com> <v34odg$kh7a$1@dont-email.me>
 <20240528185624.00002494@yahoo.com> <v359f1$nknu$1@dont-email.me>
 <20240528232315.00006a58@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 29 May 2024 01:54:24 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f50a0a3313aa9a4c5e71b452f1561318";
	logging-data="870127"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX190WVVALS9haE4kr3Nkhpfn"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:0LFhI52RzQc0xLiAzyaCXcCAeg8=
Content-Language: en-GB
In-Reply-To: <20240528232315.00006a58@yahoo.com>
Bytes: 3055

On 28/05/2024 21:23, Michael S wrote:
> On Tue, 28 May 2024 19:57:38 +0100

>> OK, I had go with your program. I used a random data file of exactly
>> 100M bytes.
>>
>> Runtimes varied from 4.1 to 5 seconds depending on compiler. The
>> fastest time was with gcc -O3.
>>
> 
> It sounds like your mass storage device is much slower than aging SSD
> on my test machine and ALOT slower than SSD of David Brown.

David Brown's machines are always faster than anyone else's.

Your machine showed 1.3 seconds for 50MB, or 2.6 seconds for 100MB.

Unchanged, the fastest on my machine was 4.1 seconds for 100MB.

I've since tweaked your program to isolate the reading and writing 
parts, also to make it load the whole file in one fread call, so that I 
can compare overall times better.

One more thing I did was to write to a specific named file, not to stdout.

Overall, gcc-O2/O3 (they're the same) now has a best timing of 1.9 
seconds. My language's version with my compiler has a best timing of 2.0 
seconds.

(Unoptimised gcc, mcc, tcc give timings of around 2.7 seconds.

DMC (and old 32-bit compiler) is unoptimised, and 1.5 optimised.

lccwin32 takes over 5 seconds in either case.)

I suspect that your system just has a much faster fgetc implementation. 
How long does an fgetc() loop over a 100MB input take on your machine?

On mine it's about 2 seconds on Windows, and 3.7 seconds on WSL. Using 
DMC, it's 0.65 seconds.