There's no reason you can't treat that memory as a normal text (ie pass the 
view's stream to StreamReader).

-----Original Message-----
From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Bill McCarthy
Sent: Sunday, February 06, 2011 7:32 PM
To: 'ozDotNet'
Subject: RE: Placeholders in large text file

There's caveats on that. Frist off it means you're using pointers kind-of 
approach which is good but it also means you immediately lose all built in text 
comparison options other than binary equality. The other big caveat is you need 
to endure replacements are the same size otherwise you end up moving a lot of 
memory around each time you make a replacement

|-----Original Message-----
|From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet- 
|boun...@ozdotnet.com] On Behalf Of Preet Sangha
|Sent: Monday, 7 February 2011 2:28 PM
|To: ozDotNet
|Subject: Re: Placeholders in large text file
|
|Sorry for hijacking the thread  - but can i recommend the use of Memory 
|Mapped Files for reading and writing large files? This will make it far 
|far quicker as changes pages in memory won't need to be stored in the 
|system page file.
|
|
|
|       On 7 February 2011 16:23, mike smith <meski...@gmail.com> wrote:
|
|
|               On Mon, Feb 7, 2011 at 1:42 PM, Bec Carter 
<bec.usern...@gmail.com> 
|wrote:
|
|
|                       On Mon, Feb 7, 2011 at 1:33 PM, Michael Minutillo
|
|                       <michael.minuti...@gmail.com> wrote:
|
|                       > Well, if the template size isn't going change and
this is
|the only app
|                       > running on the machine then so be it. Chances are
good
|that neither of those
|                       > things is true. I'd still err on the side of
having a single
|line memory at
|                       > a time because it's not like the optimization is
making it
|any harder to
|                       > read or understand.
|                       >
|
|
|                       Yup template file will mostly likely not change and
app
|will always
|                       run locally as an exe. This sort of optimisation you 
suggested seems
|                       good enough to use as it is fairly simple.
|
|                       ...But I was kinda questioning the design of doing
things
|this way at
|                       all. It seems like what I want is a dynamic "page"
(like a
|webform)
|                       that can run and spit out text just like an asp page 
does.....so the
|                       placeholders would really be <%= %> tags. Is
something
|like this an
|                       option? Can I somehow run an asp.net page locally?
Will
|this cause
|                       performance problems for 750megs of data which is 
around 70 pages? 
|Am
|                       I going completely crazy? :-)
|
|
|
|
|
|               If you're repeating the replacement a lot you could keep a 
structure 
|that pointed into the template giving the locations.
|
|               --
|
|               Meski
|
|               "Going to Starbucks for coffee is like going to prison for
sex.
|Sure, you'll get it, but it's going to be rough" - Adam Hills
|
|
|
|
|
|       --
|       regards,
|       Preet, Overlooking the Ocean, Auckland
|
|
|
|
|
|--
|regards,
|Preet, Overlooking the Ocean, Auckland



Reply via email to