[erlang-questions] Help with storing data in memory

Bob Ippolito <>
Tue Mar 23 13:14:41 CET 2010

On Tue, Mar 23, 2010 at 6:54 AM, Max Lapshin <> wrote:
> ets is of type ordered_set, because each client can read by Key from
> its own place in ets table and it needs to know ets:next for each Key.
> So, queue doesn't fit, because I need random access to frame list.
> Also, I'm afraid that array will not fit: when client seeks back in
> timeshift table, I need to find closest frame, with conditions:
> #video_frame{type = video, frame_type = keyframe, decoder_config =
> false, dts = DTS} when DTS =< RequestedDTS
> If use array, I will have to perform lookup through 40K of entries.
> However, maybe it is not bad? I need to test.

Use a binary search! Since it's used as a ring you'll have to slightly
modify the standard algorithm but all of the data is sorted and you
have cheap random access so there is no good reason to do a sequential


More information about the erlang-questions mailing list