Group: comp.lang.c++
From: asterisc
Date: Tuesday, April 08, 2008 5:06 PM
Subject: Re: Fastest! Counting words (Mirek Fidler.. continues)

On Apr 8, 10:55 pm, Razii wrote:
> On Tue, 8 Apr 2008 08:47:18 -0700 (PDT), asterisc
> wrote:
>
>
>
> >Alright man, let's do it another way.
> >Try this:
> >http://pastebin.com/d43068295
>
> printf( "Time: %ld ms\n", (end - start) / CLOCKS_PER_SEC * 1000 );
>
> I changed it back to
>
> std::cout <<"Time: " << double(end-start)/CLOCKS_PER_SEC * 1000 << "
> ms\n";
>
> zealous, 80
> zealously, 20
> Time: 1171 ms
>
> This version doesn't even compile with g++ (MinGW).

I'm sorry about that. The printf was wrong, it should have been
something like: %.0f.. and (float) in front of every number.

However, I have reproduced your algorithm in C++.
I have better results than the Java version. I tried it on two
marchines and it seems faster!

Altought is not correct (it puts lowercase in front of uppercase,
which is not ok) it behaves exactly like the Java version. Same
output, same algorithm, only a bit faster.

Here is the link:
http://pastebin.com/m1c5271bf

Try it and post the results on your machine.

I don't care about MinGW compiler. I compiled it successfull on both VC
++ 2003 on winXP and GCC 4.1.2 p1.0.2 on my Gentoo machine.

Regards,

Safety Articles | Usenet Groups | 20lbs in 30 days