Skip to content

POSIX me harder

POSIX specifies that `-exec` can be ended by a semicolon or a plus sign, the latter taking the arguments as sets (up to ARG_MAX). That said, I wonder why many half-current implementations (RHEL 4; MacOS 10.4) of find(1) still don't understand the plus sign. When working with a lot of files the difference in speed is quite visible:
 $ find /dir -type f | wc -l
 3379
 
 $ /usr/bin/time -v find /dir -type f -exec ls {} + > /dev/null
 [...]
 User time (seconds): 0.05
 System time (seconds): 0.02
 Percent of CPU this job got: 98%
 Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.07
 Minor (reclaiming a frame) page faults: 781
 Voluntary context switches: 3
 Involuntary context switches: 11

 $ /usr/bin/time -v find /dir -type f -exec ls '{}' \; > /dev/null
 [...]
 User time (seconds): 1.69
 System time (seconds): 2.76
 Percent of CPU this job got: 49%
 Elapsed (wall clock) time (h:mm:ss or m:ss): 0:09.01
 Minor (reclaiming a frame) page faults: 938927
 Voluntary context switches: 3561
 Involuntary context switches: 4779

eth0: too many iterations (6) in nv_nic_irq

The forcedeth driver for nVidia NICs had some interrupt handling issues in earlier kernels. However, as Debian/etch is still using 2.6.18, these boxen may still get flooded with messages like:
eth0: too many iterations (6) in nv_nic_irq.
A fix has been posted in 10/2007 (~2.6.22?) and as a workaround we could put the following into /etc/modprobe.conf:
options forcedeth max_interrupt_work=10

code_swarm

Oh, how wonderful is that: code_swarm takes a SVN/CVS activity log and visualizes the development progress. It's really impressing, even for smaller projects, how development went on over time. Short mini howto:
# cd project-svn
# svn log -v > /tmp/project.log
# cd ../codeswarm
# python convert_logs/convert_logs.py -s /tmp/project.log -o /tmp/activity.xml
# cp data/sample.config data/project.config
# vi data/project.config
[point InputFile to /tmp/activity.xml]
# vi build.xml
[point arg:value to data/project.config]
# ant run
You'll need X11 and a JDK for that. OpenJDK will do just fine.