*Synopsis*: ksh93 tail -f, with unconditional .25s sleep and line parsing, about 37x slower than cat
CR 6920072 changed on Mar 30 2010 by <User 1-5Q-1267> === Field ============ === New Value ============= === Old Value ============= See Also 6939349 ====================== =========================== =========================== *Change Request ID*: 6920072 *Synopsis*: ksh93 tail -f, with unconditional .25s sleep and line parsing, about 37x slower than cat Product: solaris Category: shell Subcategory: korn93 Type: Defect Subtype: Performance Status: 7-Fix in Progress Substatus: Priority: 3-Medium Introduced In Release: solaris_nevada Introduced In Build: snv_128 Responsible Engineer: <User 1-5Q-9201> Keywords: oss-request, oss-sponsor === *Description* ============================================================ Running tail -f on a nightly.log during a build on an Opensolaris snv_126 machine, I noticed that the tail was running long after the build had completed. The first time I killed it; the second time I decided to let it run. *26 minutes* after the build completed, it finally completed (the entire build had only taken 28 minutes). Now, this was across an ssh connection from EGO02 to MPK17, but I took the same log file and did several tests: tail -f: 26:XX nfs cp: 00:29 scp: 00:29 scp -C: 00:36 cat: 00:42 That's quite a difference. Trussing the command, I see that it's ksh93, and that ksh is apparently reading line-chunked things of approximately 8K, and writing line-chunked blocks to the output, and unconditionally delaying .25s between each stat/read/write call. That latter, in particular, seems to be the biggest problem, and seems ill-advised; if there's to be a delay, it seems like "stat, and if no change sleep and then stat again" would be a lot more efficient. Also, for -f, I don't see why there's any point in doing the line-oriented calls; original tail didn't, and I can't imagine it's a win. *** (#1 of 1): 2010-01-26 04:51:29 GMT+00:00 <User 1-5Q-12546> === *Public Comments* ======================================================== === *Workaround* ============================================================= === *Additional Details* ===================================================== Targeted Release: solaris_nevada Commit To Fix In Build: snv_137 Fixed In Build: Integrated In Build: Verified In Build: See Also: 6790507, 6939349 Duplicate of: Hooks: Hook1: Hook2: Hook3: Hook4: Hook5: <email address omitted> Hook6: <email address omitted> Program Management: Root Cause: Another Bug Fix Fix Affects Documentation: No Fix Affects Localization: No === *History* ================================================================ Date Submitted: 2010-01-26 04:51:29 GMT+00:00 Submitted By: <User 1-5Q-12546> Status Changed Date Updated Updated By 3-Accepted 2010-03-29 02:46:47 GMT+00:00 <User 1-5Q-9201> 7-Fix in Progress 2010-03-29 03:19:23 GMT+00:00 <User 1-5Q-9201> === *Service Request* ======================================================== Impact: Significant Functionality: Secondary Severity: 3 Product Name: solaris Product Release: solaris_nevada Product Build: Operating System: snv_126 Hardware: generic Submitted Date: 2010-01-26 04:51:30 GMT+00:00 === *Multiple Release (MR) Cluster* - 0 ======================================