Re: file.seek and unused bytes
- From: Robert Klemme <shortcutter@xxxxxxxxxxxxxx>
- Date: Mon, 06 Jul 2009 21:56:21 +0200
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/
.
- Follow-Ups:
- Re: file.seek and unused bytes
- From: Greg Willits
- Re: file.seek and unused bytes
- References:
- Re: file.seek and unused bytes
- From: Gary Wright
- Re: file.seek and unused bytes
- From: Greg Willits
- Re: file.seek and unused bytes
- From: Brian Candler
- Re: file.seek and unused bytes
- From: Greg Willits
- Re: file.seek and unused bytes
- From: Brian Candler
- Re: file.seek and unused bytes
- From: Greg Willits
- Re: file.seek and unused bytes
- From: Robert Klemme
- Re: file.seek and unused bytes
- From: Greg Willits
- Re: file.seek and unused bytes
- From: Brian Candler
- Re: file.seek and unused bytes
- From: Greg Willits
- Re: file.seek and unused bytes
- From: Thomas Chust
- Re: file.seek and unused bytes
- From: Greg Willits
- Re: file.seek and unused bytes
- Prev by Date: Help with rdoc - generate documentation for Ruby 1.9.1 Standard Library?
- Next by Date: Re: A define_method question
- Previous by thread: Re: file.seek and unused bytes
- Next by thread: Re: file.seek and unused bytes
- Index(es):
Relevant Pages
|