This question may be so obvious that even Marnen won't answer it... :)
I need to store a set of relatively complex objects in the db -- in my
case, these are discrete cumulative distribution functions: they take a
long time to construct, but I want the lookup to be fast. Since the
lookup is essentially a binary search, a B-Tree or some variant would be
a sensible data structure.
I have choices: (a) I store entire YAML'd B-Trees, (b) I store simple
data structure (e.g. arrays of numeric pairs) and spend time
constructing a B-Tree from it, or (c) choose another approach that
someone on this list points out.
Can this forum offer any advice on size / speed tradeoffs for YAML'd
objects? If unpacking a YAML'd object is fast, then (a), storing the
entire B-Tree is probably the best approach. If slow, then perhaps I'm
better off with (b), storing a minimal data structure and reconstructing
the B-Tree when I need it.
Thoughts?
- ff
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment