archseer / ruby-mpd

ruby-mpd is a powerful object-oriented Music Player Daemon library, forked from librmpd.
GNU General Public License v2.0
83 stars 32 forks source link

Use Sets during parsing for speed #58

Closed Phrogz closed 8 years ago

Phrogz commented 8 years ago

Calling @mpd.where file:'.' on a ~slow music server with ~17k songs takes 1.15 seconds. With this minimal patch (using sets instead of arrays to categorize command types) that time is reduced to 0.99 seconds, a savings of almost 14%.