-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Hello,
how do you think is it possible to optimize code:
Line 90 in 6f2bfa6
| Maildir.prototype.listNew = function(callback) { |
Maildir.prototype.listNew = function(callback) {
this.fs.readdir(this.dirPaths[NEW], callback);
};the point is for each pop operation it reads all content of the directory.
pop()->readdir()
pop()->readdir()
pop()->readdir()
In the sequence code
Line 76 in 6f2bfa6
| Queue.prototype.tryPop = function(messages, callback) { |
at
tryPop you use only 1 item from the array.
If the queue has size 1^e6 messages it .....
How about to optimize this place?
For example
- add
memoize
or - consume result from
listNew()until it has elements?
Thank you.
Metadata
Metadata
Assignees
Labels
No labels