Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '(except': 0.07; 'class,': 0.07; 'odd': 0.07; 'string': 0.09; 'bytes.': 0.09; 'oh,': 0.09; 'yeah,': 0.09; 'stored': 0.12; 'posted': 0.15; '*never*': 0.16; 'count,': 0.16; 'file).': 0.16; 'for,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'immutable,': 0.16; 'length,': 0.16; 'somewhere.': 0.16; 'xxx,': 0.16; 'wrote:': 0.18; 'coding': 0.22; 'bytes': 0.24; 'char': 0.24; 'somewhere': 0.26; 'header:In-Reply-To:1': 0.27; 'document.': 0.30; 'message- id:@mail.gmail.com': 0.30; 'code': 0.31; '>>>>': 0.31; 'there.': 0.32; 'probably': 0.32; 'raw': 0.33; 'but': 0.35; 'received:google.com': 0.35; 'edge': 0.36; 'like,': 0.36; 'scheme': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'even': 0.60; 'then,': 0.60; 'entire': 0.61; 'happen': 0.63; 'more': 0.64; '30,': 0.65; 'jul': 0.74; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=7Yh8zfMVhD7L9ocKiR2wUlo6zvFnKZBR1oHsEVJRgts=; b=yaZWHoNxZKvvg2g/IIieIrk7J2vlwNz4FAPsqcRI+BpFuLs4hP2ZJ7Z4k2bS+5BJXH tG5Qe3M2GS+6EtvLwFwulDAytcU1upyfQ5tkxFZLtsJf3yxdbbqwcmZng8sgn5nHMqQ0 36GPacW+E5qJze+cqcII65jSVBlly6W6jmlFStMBMvW0V4P3fNY/D98zceL9sNEmIGWG csQdkqLsNTq2f3Zo3/dBa82E8Px8iYnhRSoSdQjvRot1iehPSGGiklrqSwGxOiRYzscd hK6URNCFzGp5UynOA5u2bKIdloE0kVtghjNvpCDBORAdsx2g9KRxwJSkjdhpLlxhYB8o zXBg== MIME-Version: 1.0 X-Received: by 10.221.68.71 with SMTP id xx7mr124871vcb.97.1375214658929; Tue, 30 Jul 2013 13:04:18 -0700 (PDT) In-Reply-To: <39155ddf-437c-459e-ad7c-dd841810a592@googlegroups.com> References: <51DFDE65.5040001@Gmail.com> <4f1067f6-bc99-42ad-9166-37fb228b90e8@googlegroups.com> <51f14395$0$29971$c3e8da3$5496439d@news.astraweb.com> <51f15e03$0$29971$c3e8da3$5496439d@news.astraweb.com> <8203e802-9dc5-44c5-9547-6e1947ee224b@googlegroups.com> <43ce1b65-9d6d-47dd-b209-9a3bbafc0b8c@googlegroups.com> <51F7CFD1.1090403@rece.vub.ac.be> <51F7E634.2030200@mrabarnett.plus.com> <51F7EC41.5010704@rece.vub.ac.be> <51F7F48F.3070803@mrabarnett.plus.com> <39155ddf-437c-459e-ad7c-dd841810a592@googlegroups.com> Date: Tue, 30 Jul 2013 21:04:18 +0100 Subject: Re: RE Module Performance From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1375214662 news.xs4all.nl 15937 [2001:888:2000:d::a6]:58448 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:51602 On Tue, Jul 30, 2013 at 8:09 PM, wrote: > Matable, immutable, copyint + xxx, bufferint, O(n) .... > Yes, but conceptualy the reencoding happen sometime, somewhere. > The internal "ucs-2" will never automagically be transformed > into "ucs-4" (eg). But probably not on the entire document. With even a brainless scheme like I posted code for, no more than 1024 bytes will need to be recoded at a time (except in some odd edge cases, and even then, no more than once for any given file). > And do not forget, in a pure utf coding scheme, your > char or a char will *never* be larger than 4 bytes. > >>>> sys.getsizeof('a') > 26 >>>> sys.getsizeof('\U000101000') > 48 Yeah, you have a few odd issues like, oh, I dunno, GC overhead, reference count, object class, and string length, all stored somewhere there. Honestly jmf, if you want raw assembly you know where to get it. ChrisA