Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Re(2): Lesson Taught

by Anonymous Monk
on Feb 23, 2003 at 06:20 UTC ( #237864=note: print w/replies, xml ) Need Help??


in reply to Re(2): Lesson Taught
in thread Teach him a lesson with facts

Good one, man. my $i does speed it up, now the ratio become perl:java:c = 27:7:5.

But use integer does not seem to affect the result, and it should not affect the result on a 32 bit machine, when integers are less than 10^6.

I also tried 0..1,000,000 as one post suggested, it slows down the whole thing.

I then became interested in the difference between your benchmark and my result. (I didn't suspect you cook the numbers and I don't, never, just as you should not suspect me.) So I ran your benchmark testing, and got:
Benchmark: timing 5 iterations of int_iterate, iterate, lex_iterate... int_iterate: 131 wallclock secs (130.94 usr + 0.00 sys = 130.94 CPU) +@ 0.04/s (n=5) iterate: 172 wallclock secs (172.63 usr + 0.00 sys = 172.63 CPU) @ + 0.03/s ( n=5) lex_iterate: 137 wallclock secs (136.66 usr + 0.00 sys = 136.66 CPU) +@ 0.04/s (n=5) s/iter iterate lex_iterate int_iterate iterate 34.5 -- -21% -24% lex_iterate 27.3 26% -- -4% int_iterate 26.2 32% 4% --
I would believe this is due to my small mem config as I said in another reply.

But your data shows use integer speeds up the thing a lot, that part really confuses me. I don't think you are using 16 bit OS though. Did you compiled your perl yourself?

Replies are listed 'Best First'.
Re: Re: Re(2): Lesson Taught
by shotgunefx (Parson) on Feb 23, 2003 at 09:26 UTC
    The first benchmark was from a linux 2.2 kernal running 5.6.0 with an Intel Celeron 400MHZ with 256MB.

    On a ultrasparc 10 running linux 2.2 with 256 MB (5.6.1) I get similar results...
    Benchmark: timing 5 iterations of int_iterate, iterate, lex_iterate... int_iterate: 14 wallclock secs (14.19 usr + 0.12 sys = 14.31 CPU) @ +0.35/s (n=5) iterate: 53 wallclock secs (52.45 usr + 0.15 sys = 52.60 CPU) @ 0 +.10/s (n=5) lex_iterate: 47 wallclock secs (47.03 usr + 0.11 sys = 47.14 CPU) @ +0.11/s (n=5) s/iter iterate lex_iterate int_iterate iterate 10.5 -- -10% -73% lex_iterate 9.43 12% -- -70% int_iterate 2.86 268% 229% --
    Regardless... what does this actually mean? Not much. The iteration test isn't usually what the problem is. Usually it's all the stuff in-between that is the bottleneck and how fast the turn-around time is. It to me is a useless metric... (unless you're writing a video driver or such.) I think it's a case of not seeing the forest through the trees. If I was making a renderer or such that needed low-level speed I would just use XS or Inline, but the biggest thing for me is, how quick can I get a job done and how quick can I implement changes and to me Perl fits the bill perfectly.

    -Lee

    "To be civilized is to deny one's nature."
      I believe your results, but my PC does floating really quick, and as you can see it is that much close to integer, which I believe it is doing floating using hardware not software, because I have such hardware installed.

      Just to quickly point out something. The loop is not my purpose either. The original purpose to have the loop there is to make the testing result comparable.

      If I don't have the loop there, all three result would be 0.

      Loop is just a way to help gather results, just as what timthese and cmpthese do. This part actually has been misunderstood. And we both understand/saw that, online communities lots of times follow emotion more than logic.

      If we are talking face to face, we will do it slowly and carefully. But when you do it online, especially a community like this one, where lots of people weigh XP point too much, they started to jump on each other quickly and hit the most soft part of each other's body, as long as it gives them XP point, they don't really mind what they are actually talking.

      I am not pointing to you, absolutely not. I say this to you, simply because I see you as someone reasonable.

      I see the XP point system as really harmful, and it makes lots of people mentally sick.
        "Just to quickly point out something. The loop is not my purpose either. The original purpose to have the loop there is to make the testing result comparable."

        I'm probably pissing into the wind in this thread but the point about the loop test is that it's not representitive of Perl on the whole and there is always an example that will match a point of view.

        But even if it was representitive of overall execution speed, execution speed is generally only a small factor in application development. For most software 1 second versus 2 seconds is easily offset by ease of use, development time and many other factors.

        As far as the emotion of some of the posts, well this is a site devoted to Perl. If someone went to Javajunkies and gave a C > Perl > Java argument, I bet you would get the same reaction. You don't go to someones's house and attack them and argue about how much better your X is than their X and expect a balanced, level-headed argument. Might as well go to a catholic church and debate abortion. It's just not the appropriate place.

        -Lee

        "To be civilized is to deny one's nature."
Re: Re: Re(2): Lesson Taught
by Anonymous Monk on Feb 23, 2003 at 06:28 UTC
    Take back my comment on "use integer", I confused it with bigint.

    This might have something to do with our hardware difference, i.e. your machine may not have floating point hardware.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://237864]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2018-10-17 13:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When I need money for a bigger acquisition, I usually ...














    Results (95 votes). Check out past polls.

    Notices?