All of lore.kernel.org
 help / color / mirror / Atom feed
* Trivial Q about chunkd's main_loop
@ 2010-04-18  1:36 Pete Zaitcev
  2010-04-18  2:32 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Pete Zaitcev @ 2010-04-18  1:36 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Project Hail List

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)) {
 				/* BUG! */

-- Pete

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Trivial Q about chunkd's main_loop
  2010-04-18  1:36 Trivial Q about chunkd's main_loop Pete Zaitcev
@ 2010-04-18  2:32 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2010-04-18  2:32 UTC (permalink / raw)
  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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-18  2:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-18  1:36 Trivial Q about chunkd's main_loop Pete Zaitcev
2010-04-18  2:32 ` Jeff Garzik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.