Hey Jann, I would, if I only knew how! Could you tell me (I'm not new, but not a wiz!) Thankyou. mark

On 04/29/2013 04:14 PM, Jann Horn wrote:

A few days ago, I bought a Raspberry Pi. Those things don't exactly have much
computation power (700MHz ARM), but they're still quite nice. Well, when I ran
"htop", I was a bit disappointed about it using quite some CPU resources. I had
a look at the output of `strace` and saw that there was an anonymous mmap per
opened file (because of stdio) and that there were many invocations of
gettimeofday. Also, callgrind showed that quite some time was spent for parsing
scanf format strings.

I wrote a small patch that makes htop run faster (see the attachment). On my
Raspberry Pi, when filtering for "htop" and sorting by PID, htop with my patch
uses ~4-6% CPU while htop without my patch (from SVN) uses ~7-11% CPU – but
please measure yourself.

In some places, this makes the code a little bit bigger, but I think that the
increase in speed is worth it.

What do you think about this? Will you merge this patch?


Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr

htop-general mailing list