delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/09/23/20:56:02

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=0.4 required=5.0 tests=AWL,BAYES_50,SPF_NEUTRAL,TO_NO_BRKTS_PCNT
X-Spam-Check-By: sourceware.org
Message-ID: <4E7D2A84.2070105@cs.utoronto.ca>
Date: Fri, 23 Sep 2011 20:55:32 -0400
From: Ryan Johnson <ryan DOT johnson AT cs DOT utoronto DOT ca>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Relocation patch for cygwin
References: <4D430530 DOT 7050401 AT cwilson DOT fastmail DOT fm> <j5ip1t$qhd$1 AT dough DOT gmane DOT org>
In-Reply-To: <j5ip1t$qhd$1@dough.gmane.org>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 23/09/2011 4:10 PM, jojelino wrote:
> On 2011-01-29 AM 3:04, Charles Wilson wrote:
>> On the cygwin list, Corinna Vinschen, one of the main cygwin developers
>> and project lead, noticed a problem with libiconv's behavior on cygwin
>> 1.7.x (which I'll follow up on the appropriate list, in a few days).
>>
>> However, while she was investigating it, she ran across some very
>> obsolete code in the relocation support employed by libintl.  In keeping
>> with cygwin's mantra of "more like unix, less like windows", she
>> suggested the following changes.  These basically make cygwin's
>> relocation support use the linux machanisms (/proc/self/maps,
>> /proc/self/exe) rather than relying on win32 mechanisms like
>> GetModuleFileName, DllMain(), and the like.
> It fixed the relocation problem. but led performance issue :(
>
> $ time id > /dev/null
>
> real    0m0.141s
> user    0m0.000s
> sys     0m0.000s
>
> The attached is report gprof produced when invoked *id* . as you can 
> see, format_process_maps consumes 70% of the lifetime(0.5s with 
> profiling overhead). this is reproducible whenever we do 
> open('/proc/self/maps').
> the problem is, the cost is too expensive. gnulib should care about 
> cygwin do sacrifice performance for compatibility.
> As a workaround, how about rebuild libintl without capacity of 
> relocatable?
> because in cygwin libintl is expected to place in /bin so there's no 
> use of relocatable.
Hmm. I'm not up to speed on what the relocation issue is/was, but from 
what I've seen of the proc/*/maps code path, they are expensive enough I 
would think twice about putting it on the critical path. That said, the 
amount of time consumed makes me wonder if the file is being opened/read 
multiple times, resulting in O(n^2) work overall.

Ryan


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019