Re: [notmuch] [PATCH -V3 1/2] notmuch-reply: Add support for replying only to sender
[notmuch-archives.git] / a8 / 546826da152591df5a0aaf9ab320754dbc0c4f
1 Return-Path: <tom@dbservice.com>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id AE118431FBC\r
6         for <notmuch@notmuchmail.org>; Mon, 21 Dec 2009 14:07:49 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 Received: from olra.theworths.org ([127.0.0.1])\r
9         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
10         with ESMTP id slNNwgGyaq6r for <notmuch@notmuchmail.org>;\r
11         Mon, 21 Dec 2009 14:07:48 -0800 (PST)\r
12 X-Greylist: delayed 1803 seconds by postgrey-1.32 at olra;\r
13         Mon, 21 Dec 2009 14:07:48 PST\r
14 Received: from office.neopsis.com (office.neopsis.com [78.46.209.98])\r
15         by olra.theworths.org (Postfix) with ESMTP id 7A856431FAE\r
16         for <notmuch@notmuchmail.org>; Mon, 21 Dec 2009 14:07:48 -0800 (PST)\r
17 Received: from calvin.caurea.org ([62.65.141.13])\r
18         (authenticated user tom@dbservice.com) by office.neopsis.com\r
19         (using TLSv1/SSLv3 with cipher AES256-SHA (256 bits));\r
20         Mon, 21 Dec 2009 22:37:41 +0100\r
21 Message-ID: <4B2FEAA5.9020500@dbservice.com>\r
22 Date: Mon, 21 Dec 2009 22:37:41 +0100\r
23 From: Tomas Carnecky <tom@dbservice.com>\r
24 User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US;\r
25         rv:1.9.3a1pre) Gecko/20091216 Lightning/1.1a1pre Shredder/3.1a1pre\r
26 MIME-Version: 1.0\r
27 To: James Westby <jw+debian@jameswestby.net>\r
28 References: <1261315232-21494-1-git-send-email-tom@dbservice.com>\r
29         <1261332167-17994-1-git-send-email-jw+debian@jameswestby.net>\r
30 In-Reply-To: <1261332167-17994-1-git-send-email-jw+debian@jameswestby.net>\r
31 Content-Type: text/plain; charset=UTF-8; format=flowed\r
32 Content-Transfer-Encoding: 7bit\r
33 Cc: notmuch@notmuchmail.org\r
34 Subject: Re: [notmuch] [PATCH] Solaris doesn't have 'struct dirent::d_type'\r
35 X-BeenThere: notmuch@notmuchmail.org\r
36 X-Mailman-Version: 2.1.12\r
37 Precedence: list\r
38 List-Id: "Use and development of the notmuch mail system."\r
39         <notmuch.notmuchmail.org>\r
40 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
41         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
42 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
43 List-Post: <mailto:notmuch@notmuchmail.org>\r
44 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
45 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
47 X-List-Received-Date: Mon, 21 Dec 2009 22:07:49 -0000\r
48 \r
49 On 12/20/09 7:02 PM, James Westby wrote:\r
50 > From: Tomas Carnecky<tom@dbservice.com>\r
51 >\r
52 > Use stat(2) instead.\r
53 >\r
54 > Signed-off-by: Tomas Carnecky<tom@dbservice.com>\r
55 > Signed-off-by: James Westby<jw+debian@jameswestby.net>\r
56 > ---\r
57 >\r
58 >    The original patch duplicated asprintf and stat calls, rearraging\r
59 >    the code means we don't need to.\r
60 >\r
61 >    I have a concern about the duplicated stats in is_maildir, but they\r
62 >    are not so easy to save. I ran a quick timing test (3931 files), dropping\r
63 >    caches before each set:\r
64 >\r
65 >      master:\r
66 >        real  2m3.545s\r
67 >        real  1m34.571s\r
68 >        real  1m36.005s\r
69 >\r
70 >      original patch:\r
71 >        real  2m18.114s\r
72 >        real  1m34.843s\r
73 >        real  1m36.317s\r
74 >\r
75 >      revised patch:\r
76 >        real  2m5.890s\r
77 >        real  1m36.387s\r
78 >        real  1m36.453s\r
79 >\r
80 >    This shoes there is little impact of the code, but given that it is\r
81 >    around one percent we may want to make it conditional on platform\r
82 >    and save the extra stat calls.\r
83 \r
84 If performance regression is an issue, something like this could be used \r
85 to keep the current code paths in linux and stat() on other platforms:\r
86 \r
87 static bool\r
88 is_dir(const char *path, struct dirent *dirent)\r
89 {\r
90 #if defined(__sun__)\r
91         ... sprintf, stat etc\r
92 #else\r
93         (void) path;\r
94         return dirent->d_type == DT_DIR;\r
95 #endif\r
96 }\r
97 \r
98 tom\r
99 \r