summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/Plugins/Monitors/Net.hs
AgeCommit message (Collapse)Author
2019-10-28Optimize Net a bit (noticeably less CPU/power usage)Tomas Janousek
- use strict ByteString as the Lazy version of readFile allocates a 32k buffer even though we usually need much less (isUp needs a few bytes) - refactor NetDev datatype and use unsafeInterleaveIO in isUp to avoid reading the operstate file entirely if we're not interested in that device - postpone ByteString unpacking in netParser to shave off some cycles, and avoid ByteString unpacking in isUp entirely On my system with 8 network devices (and more if docker is up), this seems to reduce xmobar's CPU usage noticeably. I have two "Run Network" in xmobar configuration, for eth and wlan, so without these changes, xmobar would evaluate isUp 16 times a second, and each evaluation would allocate a buffer for the IO Handle and then another buffer for the lazy ByteString readFile. Now it only does isUp once for every device I'm interested in, and the only large buffers allocated are the IO Handle ones (getting rid of these isn't worth the code complexity).
2019-10-21add filtering option for Net devices (#408)vindex10
* add filtering option for Net devices * relate to comments * upd readme * add few more words to readme
2018-11-25Back to app/src, since it seems they're the default convention for stackjao
2018-11-21All sources moved inside srcjao
2018-11-21Split Modules into Library & Executable StructurePavan Rikhi
Move the Main module to a new `app` directory. All other modules have been nested under the `Xmobar` name. Lots of module headers & imports were updated.