How fast is seek?

D

David Morel

seek FILEHANDLE,POSITION,WHENCE

How fast is seek?

I am using the seek function on some large files, for simplicity. Are
there any benchmarks on the speed of this function (WHENCE = 0)?
 
B

Bob Walton

David said:
seek FILEHANDLE,POSITION,WHENCE

How fast is seek?

I am using the seek function on some large files, for simplicity. Are
there any benchmarks on the speed of this function (WHENCE = 0)?

That varies tremdously with your hardware platform and OS. Why don't
you use Benchmark; on your system and find out for yourself?
 
T

Tad McClellan

David Morel said:
seek FILEHANDLE,POSITION,WHENCE

How fast is seek?


As fast as your OS can make it.

Did you mean to ask if there is a faster alternative or something?
 
E

Eric J. Roode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

(e-mail address removed) (David Morel) wrote in
seek FILEHANDLE,POSITION,WHENCE

How fast is seek?

I am using the seek function on some large files, for simplicity. Are
there any benchmarks on the speed of this function (WHENCE = 0)?

In my experience (unix), seek just modifies an internal counter and an
internal flag, and doesn't touch the file at all. So it has next to zero
execution time. If a filehandle is open for write, it may or may not need
to do a flush before the seek, so that may slow down certain seeks.

What's your real question?

- --
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBP29R0GPeouIeTNHoEQK07QCdEBiUoCy2IXnzoV48fRK/9/v5pjYAoKTO
K0ZGMnmhbNQ76NgSgZzYmDmm
=67RF
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top