|
Sequential vs. Random access: msg#00083statistics.pspp.devel
On Wed, Jan 31, 2007 at 07:10:13AM -0800, Ben Pfaff wrote: John Darrington <john@xxxxxxxxxxxxxxx> 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.
pspp-dev mailing list pspp-dev@xxxxxxx http://lists.gnu.org/mailman/listinfo/pspp-dev |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Thank you + question about unicode support in PSPP: 00083, John Darrington |
|---|---|
| Previous by Thread: | Re: [patch #5690] Clean up case codei: 00083, Ben Pfaff |
| Next by Thread: | [patch #5683] Add deque implemented as circular queue to libpspp: 00083, Ben Pfaff |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |