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

Re^4: selecting columns from a tab-separated-values file

by sundialsvc4 (Abbot)
on Jan 22, 2013 at 21:16 UTC ( #1014793=note: print w/replies, xml ) Need Help??

in reply to Re^3: selecting columns from a tab-separated-values file
in thread selecting columns from a tab-separated-values file

Bah, humbug ...   ;-)

There’s one million-pound elephant in this room, if there is one at all, and that elephant certainly won’t consist of the mere-microseconds that a CPU will require to split-up a chunk of data that came in from a disk drive.   We’re not reading graphic-images here and resizing them ... the task to be performed against each unit of data is quite inconsequential.   The advantage comes from being able to gulp large amounts of data at a time from a disk device that (probably ...) does not have to spend too much time dong it.   (Although, depending on the peculiarities of physical distribution of the file-in-question across the disk real estate, that might not turn out to be so.)

“What is the array of hashrefs for?”   Why, you yourself said it!   Even though “the input is a stream, and the output is a stream,” there is probably only one device.   A physical operation consisting of seek + read or seek + write, which we desire to reduce to the point that no seek is required.   We want:   seek($$) + read + read + read + ... + read + seek($$) + write + write .... + write + seek ($$).

The specific reason why I questioned the validity of threads in this scenario, was that I judged the amount of CPU-intensive processing required to be pragmatically inconsequential relative to the amount of time that would be spent in an I/O-wait.   Also, it was because I judged that the physical latency cost of the disk device would be the “above all, ruling constraint” no matter what.   Pragmatically, we can afford to spend a few microseconds crunching numbers because the disk platter won’t have rotated too far during that time anyway.

But there is only so far that the point can be argued before it becomes merely an argument.   If the per-record CPU load is indeed slight to the point of being inconsequential, then memory is a big fat available buffer that costs nothing ... if, indeed paging is not occurring, so that it really does cost “nothing.”   But if a page-fault that must be resolved to disk does take place, then you just moved that read/write head after all.   Overlapping I/O with CPU-processing might prove to be beneficial on the OP’s system, not yours... or not.   If it were me, I would start by using the RAM as a buffer, see how much bang that buck got me, then pragmatically move forward from there.

It doesn’t advance the technical validity of your arguments to belittle the opinions others, you know... no matter how personally self-assured you might be.

  • Comment on Re^4: selecting columns from a tab-separated-values file

Replies are listed 'Best First'.
Re^5: selecting columns from a tab-separated-values file
by BrowserUk (Pope) on Jan 22, 2013 at 22:19 UTC
    It doesn’t advance the technical validity of your arguments to belittle the opinions others, you know... no matter how personally self-assured you might be.

    I am not belittleing your opinion. There is no matter of opinion involved. This is not a subjective matter; it is a quantifiable, easily measured, matter of right and wrong; fact and fiction. And you provided fiction, whilst I provided fact.

    I am telling directly and definitively and unambiguously, that the technical content -- such as it is -- in both your first post and this one are both theoretically -- and demonstrably -- factually incorrect. Ie. You are wrong!

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1014793]
[Cosmic37]: I'm wondering whether there is a specific/(or at least "usual") command or does one take a copy before undefining and then copy it back after slurping file into a string?
[BarApp]: I need help accessing perl files. I need permission!!!
[Cosmic37]: I wish thee a peachy life and express gratitude for considering my pathetic questions
[erix]: record separator
[Cosmic37]: Permissions are interesting earthlings. Did nature determine who gives permission and who asks permission. Who was the first to get permission? Are you not related to them as one big earthling family?
[karlgoethebier]: Cojones! We need cojones!
[karlgoethebier]: Ouch! Permissions! We need permissions!

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2017-06-29 16:39 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (672 votes). Check out past polls.