Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: using syscalls in perl through inline c

by afoken (Chancellor)
on Jan 16, 2017 at 14:17 UTC ( [id://1179671]=note: print w/replies, xml ) Need Help??


in reply to using syscalls in perl through inline c

My problem is I want to use the getdents() syscall from perl to receive a file list

Use readdir. Long form of this posting.

See using Linux getdents syscall and failing to use getdents system call on Linux for other futile attempts.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
  • Comment on Re: using syscalls in perl through inline c

Replies are listed 'Best First'.
Re^2: using syscalls in perl through inline c
by ofer (Novice) on Jan 16, 2017 at 14:21 UTC
    the reason behind using inline c is speed readdir is not fast enough to read millions of files.

      Have you compared the C code to pure Perl code? Most often, it's the I/O of the disk subsystems that are the bottleneck, not the code itself.

      I'm not saying that's absolute in all cases, but it may be prudent to do a one-off test between the two before making any decisions.

Re^2: using syscalls in perl through inline c
by glasswalk3r (Friar) on Apr 23, 2017 at 18:23 UTC
    See using Linux getdents syscall and failing to use getdents system call on Linux for other futile attempts.

    No, it is not futile. See Linux::NFS::BigDir.

    It's harder to solve that way, but performance difference on the specific case I tested (large directories over NFS version 3) by using readdir and going down to the getdents can be measured in hours.

    It might be a problem with the NFS server configuration? Yes, but I didn't have time to search for it or even root access to attempt.

    Alceu Rodrigues de Freitas Junior
    ---------------------------------
    "You have enemies? Good. That means you've stood up for something, sometime in your life." - Sir Winston Churchill

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2024-04-24 03:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found