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

Re^7: Working with fixed length files (Crap benchmark!)

by BrowserUk (Patriarch)
on Apr 28, 2011 at 19:33 UTC ( [id://901856]=note: print w/replies, xml ) Need Help??


in reply to Re^6: Working with fixed length files
in thread Working with fixed length files

The reason all the code runs the same speed is because sysread doesn't work on ramfiles, so the loops are never being entered.

That also explains the dramatic slowdown affect of local $/ = \nnn;. It adds an operation to a call that does almost nothing, and twice almost nothing is longer than 1 times almost nothing.

Which brings up another mystery entitled: "The Strange Case of the Disappearing AutoDie".


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^8: Working with fixed length files (Crap benchmark!)
by Tux (Canon) on Apr 29, 2011 at 09:46 UTC

    autodie was removed so I could bench on older perls.

    Good analisys! That should teach me :/

    sysread basically means "bypass PerlIO, do a read ()", so that means PerlIO::scalar doesn't get a say in it. However whether that is how things should be is a different matter.


    Enjoy, Have FUN! H.Merijn
Re^8: Working with fixed length files (Crap benchmark!)
by Tux (Canon) on Apr 29, 2011 at 11:37 UTC

    With all sysread's re-placed by read's my bench shows much more reliable figures:

    Rate buk ike1 ike2 buk 81.1/s -- -43% -46% ike1 143/s 76% -- -5% ike2 150/s 85% 5% --

    I think it would be hard to reduce the overhead even more.


    Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-19 22:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found