• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Fast reading from files, using a pre-fetch approach?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fast reading from files, using a pre-fetch approach?


  • Subject: Re: Fast reading from files, using a pre-fetch approach?
  • From: "Theodore H. Smith" <email@hidden>
  • Date: Sun, 11 Feb 2007 23:54:26 +0000


Hi Robert,

Thanks a lot. But I can't see how pread will help me more than read. It seems to do almost the same thing except not shift the file seek position.

There must be SOME unix way to read asyncronously and uncached?

This seems to be a very quiet list. Perhaps no one is optimising anything for MacOSX? ;)

On 10 Feb 2007, at 23:18, Robert Barris wrote:

I'd start with "pread" which bypasses disk caching, and in much bigger chunks than 64KB.


-----Original Message-----
From: perfoptimization-dev-bounces +rbarris=email@hidden on behalf of Theodore H. Smith
Sent: Sat 2/10/2007 3:15 PM
To: email@hidden
Subject: Fast reading from files, using a pre-fetch approach?


Is it possible to write some kind of layer that will allow for fast
streaming from files, by using a pre-fetch approach?

That is, let's say I read in 64KB syncronously. Then before returning
I read 64KB non-syncronously.

I let the user process the first 64KB. And I hope by the time he's
processed the first 64KB, that the next chunk is already read in. If
it's not, I'll make the user wait till it is.

Subsequent reads will also be "pre-fetched".

Like this, I could theoretically double data throughput. Or at least
I'll be able to do reading "for free".

Anyone know how I'd go about doing such a thing, though? I was
looking at read and setvbuf, but none of the flags or modes look what
I need.

And more importantly, I need some kind of notication back when the
data's been read in!

Ideally, I wouldn't get a callback, but actually a variable written
into some location in my RAM. So here's my ideal API.

bool FastRead( int FileDes, char* Dest, int Bytes, int*
ResultInHereWhenReadHasCompleted );

ResultInHereWhenReadHasCompleted is just some location, that will
contain some flag after the read has completed.

I'd like to do something similar for writes too.

Is there some cross platform Unix way of doing this?

I'm aiming to optimise for OSX, but at the very least I want a normal
speed but reliable one for the other platforms.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
PerfOptimization-dev mailing list (PerfOptimization- email@hidden)
Help/Unsubscribe/Update your Subscription:
40blizzard.com


This email sent to email@hidden



_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Fast reading from files, using a pre-fetch approach?
      • From: "Theodore H. Smith" <email@hidden>
    • Re: Fast reading from files, using a pre-fetch approach?
      • From: Aaron Burghardt <email@hidden>
    • Re: Fast reading from files, using a pre-fetch approach?
      • From: Laurence Harris <email@hidden>
    • Re: Fast reading from files, using a pre-fetch approach?
      • From: James Bucanek <email@hidden>
  • Prev by Date: Re: Don't really understand why there are so many settings
  • Next by Date: Re: Don't really understand why there are so many settings
  • Previous by thread: Re: Again Problem with OpenGl on iMac...
  • Next by thread: Re: Fast reading from files, using a pre-fetch approach?
  • Index(es):
    • Date
    • Thread