Christophe-Marie Duquesne <chm.duque...@gmail.com> wrote:

> On Wed, Dec 1, 2010 at 2:34 AM, Ramil Farkhshatov <ra...@gmx.co.uk> wrote:
> > it doesn't run match() on each item, that increases speed and
> > reduces cpu usage. But conditions to run match() must be reconsidered:
> > in this patch it is called once a second.
>
> Would it make sense to call match() only when there is nothing left to
> read on stdin (in your example, that would be when readstdin() returns
> 0)?

If dmenu starts matching after exhausting of data then it will not
differ in behaviour from synchronous vanilla version. The condition may
be something like: 

(time_since_last_match_ms > threshold_ms 
|| items_since_last_match > threshold_nitems
|| data_exhausted)

Reply via email to