[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Sequential vs. Random access
From: |
John Darrington |
Subject: |
Sequential vs. Random access |
Date: |
Thu, 1 Feb 2007 08:37:56 +0900 |
User-agent: |
Mutt/1.5.9i |
On Wed, Jan 31, 2007 at 07:10:13AM -0800, Ben Pfaff wrote:
John Darrington <address@hidden> writes:
> On Tue, Jan 30, 2007 at 10:30:43PM -0800, Ben Pfaff wrote:
>
> So I'm not proposing to
> encourage use of random access where it's not necessary.
>
> Would it therefore be worth having a flag passed to the casereader
> constructor which declares whether or not the casereader performs
> random access?
What's the intended usage?
Well I suppose it's similar to declaring a variable const. If we
have something similar to
struct casereader *sequential_reader = create_casereader (SEQUENTIAL);
or
struct casereader *random_reader = create_casereader (RANDOM);
and the implementation enforces sequential-only access unless random
is requested, then there may be two possible advantages:
1. By declaring a reader sequential, we can trap inadvertent random
access. In code reviews, any use of random readers is obvious,
and the reviewer may be able to suggest a faster method using
sequential access.
2. Maybe the implementation can make internal optimisations if it's been
passed the SEQUENTIAL flag?
Of course I don't know if this really fits in with your code. It's
just a suggestion.
J'
--
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.
signature.asc
Description: Digital signature
- [patch #5690] Clean up case code, (continued)
Re: [patch #5690] Clean up case code, John Darrington, 2007/01/30
- Re: [patch #5690] Clean up case code, Ben Pfaff, 2007/01/30
- Re: [patch #5690] Clean up case code, Ben Pfaff, 2007/01/30
- Re: [patch #5690] Clean up case code, John Darrington, 2007/01/30
- Re: [patch #5690] Clean up case code, Ben Pfaff, 2007/01/31
- Re: [patch #5690] Clean up case code, Ben Pfaff, 2007/01/31
- Re: [patch #5690] Clean up case code, John Darrington, 2007/01/31
- Re: [patch #5690] Clean up case code, Ben Pfaff, 2007/01/31
- Sequential vs. Random access,
John Darrington <=