From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS14383 205.234.109.0/24 X-Spam-Status: No, score=0.0 required=3.0 tests=MSGID_FROM_MTA_HEADER shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: James Tucker Newsgroups: gmane.comp.lang.ruby.rainbows.general Subject: Re: [RFC/PATCH] event_machine: lazily set async env keys Date: Thu, 15 Jul 2010 22:43:06 +0100 Message-ID: References: <20100715060338.GA2561@dcvr.yhbt.net> <20100715210530.GA30751@dcvr.yhbt.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1279230310 30900 80.91.229.12 (15 Jul 2010 21:45:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 15 Jul 2010 21:45:10 +0000 (UTC) To: Rainbows! list Original-X-From: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Thu Jul 15 23:45:08 2010 Return-path: Envelope-to: gclrrg-rainbows-talk@m.gmane.org X-Original-To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Delivered-To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:mime-version :subject:from:in-reply-to:date:content-transfer-encoding:message-id :references:to:x-mailer; bh=MMGZrjfzjk4nbEXivMRnsTuUqaSC0PXhyLo101ZCx6E=; b=oQjjJWIFCwIrLJOkAEWjLPaCxysHK4eR8xWnMPQaaSqhHxoetc6mkpn+gRtTZvSY9I 7JqlP2t9erKiToFWpqrT3Nmz4i/awoslkAsoHDk6/nRJoeWyCihbbnSbo9XpQGQNLpmj ZJCGu43CWUc5dT+1UmDWtT04acuNaSRGFFzYA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=F5Lpdepm+7mTefemUI063SuycCKmNg2/07X5vPKicLqzv/p2EGRltTA+gG/oKUqrve CT1Muco/u0E7dP1or0sDI6ueQ5aSb3hS4OVCbTmWabtEj/EBEDVzT6Z++imCFFRYzKUk q9FZCezZV0X8msMw+fR+22YQHlQsz7Mpy7W34= In-Reply-To: <20100715210530.GA30751-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org> X-Mailer: Apple Mail (2.1081) X-BeenThere: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Errors-To: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Xref: news.gmane.org gmane.comp.lang.ruby.rainbows.general:104 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OZWEr-0000mB-9q for gclrrg-rainbows-talk@m.gmane.org; Thu, 15 Jul 2010 23:45:05 +0200 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id BDF901858357; Thu, 15 Jul 2010 17:45:04 -0400 (EDT) Received: from mail-ew0-f50.google.com (mail-ew0-f50.google.com [209.85.215.50]) by rubyforge.org (Postfix) with ESMTP id B7A2E1858317 for ; Thu, 15 Jul 2010 17:43:11 -0400 (EDT) Received: by ewy4 with SMTP id 4so462224ewy.23 for ; Thu, 15 Jul 2010 14:43:11 -0700 (PDT) Received: by 10.213.33.73 with SMTP id g9mr280545ebd.46.1279230190728; Thu, 15 Jul 2010 14:43:10 -0700 (PDT) Received: from [192.168.1.101] (bb-87-81-237-21.ukonline.co.uk [87.81.237.21]) by mx.google.com with ESMTPS id x54sm11603438eeh.17.2010.07.15.14.43.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 15 Jul 2010 14:43:09 -0700 (PDT) On 15 Jul 2010, at 22:05, Eric Wong wrote: > James Tucker wrote: >> On 15 Jul 2010, at 07:03, Eric Wong wrote: >> >>> This has the small likelyhood of breaking apps that >>> check via: >>> env.include?("async.callback") >>> >>> Or any of member?/has_key?/key?, as they're all the same method. > >> Just regarding the async close, it's used primarily when the client >> disconnects so that you can stop asynchronous operations. It's quite >> important from a resource standpoint. > > OK, but the EM::DefaultDeferrable object is never touched (or > even instantiated), then there's no need to close it. > >> Why don't you just use a lambda instead of a method? >> >> lambda { |*args| em_write_response(*args) } >> >> That'd avoid the leak, and provide nearly the same performance >> profile. In fact on 1.9, lambdas are pretty damn quick. > > Durr... I didn't think of that :x > > Since 1.9.2 is in RC with few users and this bug has a fix (at > http://redmine.ruby-lang.org/issues/show/3466), we might as well leave > the code as-is for now and skip my proposed patch. Any objections? > > I try to avoid working around other projects' bugs (and just helping fix > them). This is especially the case for things like 1.9.2 which is still > in the very early stages of adoption. I have a similar patchset i'm not putting in for Thin. Also, the EM adjustment I made merely reduces the impact, and also increases performance: http://github.com/eventmachine/eventmachine/commit/60b6472da952c7cdc59f093f93678dbd1739ab0a _______________________________________________ Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org http://rubyforge.org/mailman/listinfo/rainbows-talk Do not quote signatures (like this one) or top post when replying