From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Garzik Subject: Re: Trivial Q about chunkd's main_loop Date: Sat, 17 Apr 2010 22:32:03 -0400 Message-ID: <4BCA6F23.9010108@garzik.org> References: <20100417193607.2fdded91@redhat.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=42RBx4Wr+wWEmHB3xoBtIRaHshCM5SGrAYzuCaOb5KU=; b=l23TscbuVkt3aiM4nYxbE3VMON5LdMkN4eB0TXwWUxAjTV/jY4gPJENcMH0h/xVczl twpLgfqPd1KzBGiIi93dhvCRdJR/9DllHYz8y4/TBPaZi9jMte4LNSbg/5lR48+fkZ8n xkiUwHO7DOrcsgUp9GBSE7xJSD/QUBIAv90IM= In-Reply-To: <20100417193607.2fdded91@redhat.com> Sender: hail-devel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Pete Zaitcev Cc: Project Hail List On 04/17/2010 09:36 PM, Pete Zaitcev wrote: > Is there a reason why the main_loop in chunkd uses a naked > g_hash_table_lookup instead of srv_poll_lookup? Performance? > > @@ -1681,8 +1681,7 @@ static int main_loop(void) > > fired++; > > - sp = g_hash_table_lookup(chunkd_srv.fd_info, > - GINT_TO_POINTER(pfd->fd)); > + sp = srv_poll_lookup(pfd->fd); > if (G_UNLIKELY(!sp)) { Looks like it should be changed to call srv_poll_lookup(), indeed. srv_poll_lookup() is marked 'static', so there should not be any performance difference after the compiler's optimizer passes get finished with it. Jeff