[Bug 6914] New: tail is inefficient and pops up in top

bugzilla at busybox.net bugzilla at busybox.net
Fri Feb 21 20:37:49 UTC 2014


https://bugs.busybox.net/show_bug.cgi?id=6914

           Summary: tail is inefficient and pops up in top
           Product: Busybox
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: Other
        AssignedTo: unassigned at busybox.net
        ReportedBy: yuri at tsoft.com
                CC: busybox-cvs at busybox.net
   Estimated Hours: 0.0


I am running this command:
# cat /dev/urandom | hexdump -C | tail -n100000

On Android tail command pops up in top with ~75% CPU.
As a comparison, on FreeBSD hexdump pops up in profile with ~100% CPU, as it
should be.

Generating the hex dump should require much more work, because the program
needs to print separate bytes as combinations of 2-3 characters. And tail only
needs to scan a buffer for a newline character, and keep the appropriate
rolling buffer.

tail needs to be improved to work faster.

NOTE On Android tail takes 75% CPU and not 100% CPU because the random number
generator in Android is also slow (not a BusyBox problem). Otherwise it would
have been 100% as well.


# tail --help
BusyBox v1.21.0 (2013-07-08 16:00:47 CEST) multi-call binary.

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the busybox-cvs mailing list