Hi Meikel,

2010/5/27 Meikel Brandmeyer <m...@kotka.de>

> Hi,
>
> On Thu, May 27, 2010 at 12:33:20PM -0700, CuppoJava wrote:
>
> > Your solution is very clear Meikel. I don't have a benchmark. I'm just
> > worried about the overhead of creating seqs. You use two map's and one
> > vector (which each create a seq I think). The array's will be several
> > gigabytes in size so it might build up.
>
> No problem due to laziness. d as well as w will only be traversed once.
>

But you will still have the cost of creating 2 or 3 times several millions
of Seq objects, even if they are quickly made GCable.


>
> > I forgot to mention that documents can only be loaded in one at a
> > time. Loading a new document releases the currently loaded document.
> > So memoize won't quite work. But I can figure out the details myself.
>
> memoize will work as long as d is sorted, ie. your 0 0 0 1 1 1 blocks
> won't repeat eg. like 0 0 1 1 1 0 1 0 2 ...
>


The OP said that arrays will be several gigabytes in size, so even if the
set of different docs in much less than that by an order of magnitude (or
even 2), memoizing a million of docs and then being forced to kill the VM
may not be an option for him !

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to