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: AS6939 64.71.128.0/18 X-Spam-Status: No, score=-2.0 required=3.0 tests=AWL,BAYES_00, MSGID_FROM_MTA_HEADER shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.lang.ruby.kgio.general Subject: Re: [PATCH 2/3] use rb_str_subseq for tail string on write Date: Wed, 30 May 2012 18:57:25 +0000 Message-ID: <20120530185725.GA17661@dcvr.yhbt.net> References: <1338386216-14568-1-git-send-email-funny.falcon@gmail.com> <1338386216-14568-2-git-send-email-funny.falcon@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1338404341 17804 80.91.229.3 (30 May 2012 18:59:01 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 30 May 2012 18:59:01 +0000 (UTC) To: kgio@librelist.com Original-X-From: kgio@librelist.com Wed May 30 20:59:01 2012 Return-path: Envelope-to: gclrkg-kgio@m.gmane.org List-Archive: List-Help: List-Id: List-Post: List-Subscribe: List-Unsubscribe: Precedence: list Original-Sender: kgio@librelist.com Xref: news.gmane.org gmane.comp.lang.ruby.kgio.general:159 Archived-At: Received: from zedshaw.xen.prgmr.com ([64.71.167.205]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SZo6k-0000ON-2P for gclrkg-kgio@m.gmane.org; Wed, 30 May 2012 20:58:58 +0200 Received: from zedshaw.xen.prgmr.com (localhost [IPv6:::1]) by zedshaw.xen.prgmr.com (Postfix) with ESMTP id 8770921DCE5 for ; Wed, 30 May 2012 19:06:49 +0000 (UTC) Sokolov Yura 'funny-falcon wrote: > Use rb_str_subseq for taking string's tail. rb_str_subseq do not allocate > additional memory in this case. And although it prevents from collecting > original string, it seems that tests wins both in performance and in memory > usage. > > Use fallback to rb_str_substr on ruby1.8 Thanks, applied (along with your PATCH 1/3). Will push. Looking at 3/3 now. By the way, do you test under Rubinius? I haven't in a while, but it looks like rb_str_substr() works in rbx.