Browse files

Update README with notes about performance

  • Loading branch information...
1 parent 49724ac commit 568bc7ce94ebaa42e3ce047c375c73323042853a @evanmiller evanmiller committed Aug 31, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 README.md
View
15 README.md
@@ -43,3 +43,18 @@ Each channel can have an unlimited number of subscribers. Subscribers are
removed from the channel as soon as the first message is delivered, so
to keep a subscription active you need to keep re-subscribing using the
returned Timestamp as the input to the next call.
+
+Limitations
+==
+
+Internally, messages are stored in a list. This is not terribly efficient.
+As a result, push/2 is O(N + K) where N is the number of non-expired messages
+and K is the number of subscribers. Other operations are either constant-time
+or proportional to the number of returned messages.
+
+If a channel does not receive any new messages, but continues receiving other
+requests, the old messages may linger in memory indefinitely. Old messages are
+purged with every "push" operation on a channel, but not with other operations.
+Note that the channel itself is eliminated if max_age passes without any
+channel activity, so this should only be a concern if there are "polls" and
+"subscribes" on a channel without any new "pushes".

0 comments on commit 568bc7c

Please sign in to comment.