Re: file.seek and unused bytes



On 06.07.2009 21:47, Greg Willits wrote:

What about storing all file offsets
in an Array and write it to a file

That's a possibility that would be an easy retrofit and probably w/o breaking the current interfaces. It would use a little more RAM, but would eliminate calculating that offset each time during reads. That's not a real pinch point, but worth an experiment just because it's a simpler concept to recognize.

I'd be interested to learn the outcome of that exercise.

Did you consider to make your dsl generate the code or is that what you are doing?

If I interpret the question correctly, that's what we're doing. I may be using "DSL" a little loosely here though. It's more like an "active config" language. I write setup files that are a mixture of k-v pairs for certain things, and expressions for other things. All of that gets processed at the start of every aggregation run which results in a number of Ruby Module files being created which get included dynamically.

Only that you do not need to write this into files but you can do that in memory with eval. Anyway, that's just a detail. :-)

Many thanks for all the thoughts & feedback.

You're welcome!

Kind regards

robert

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
.



Relevant Pages

  • Re: Which is faster--Array or ADO
    ... into RAM be it an array, or that of a reocrd set. ... one is not necessarily going to your processing speed because it is ram. ... read one record from disk into array ...
    (microsoft.public.access.modulesdaovba)
  • Re: Large strings and out of memory
    ... > RAM and even servers today are often configured with less than 2GB RAM I ... > that works with disk. ... The disk writes a 10M block once full then restarts, the dynamic array ... The disk array is not only far more controllable, ...
    (comp.lang.pascal.delphi.misc)
  • Re: Out of Memory Problem in VB 6.0 Application.
    ... that's a fixed size array. ... > block of memory. ... Just think of it as 2gigs of ram that you have at your disposal. ... matter if that's real ram or swap file it's still 2 gigs available to your ...
    (microsoft.public.vb.general.discussion)
  • Re: New install partitioning question
    ... or for when memory greedy servers overallocate RAM ... Since pagefile is only temporary, ... first partition on the array, but that's really just an inexact way to mock ... OS, Logs, Pagefile, Data and Apps. ...
    (microsoft.public.windows.server.setup)
  • Re: Migrating VC++ 6.0 apps to .NET
    ... You need to pin the arrays and then passed the pinnen version. ... TBLexp automatically creates interfaces ... > this case we won't be able easily migrate our old app to .NET platform. ... > Can anyone provide good examples how to convert array array of managed ...
    (microsoft.public.dotnet.languages.vc)