Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.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.025 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'encoded': 0.07; 'memory.': 0.07; 'string': 0.09; "'a'": 0.09; 'bits': 0.09; 'bytes,': 0.09; 'level:': 0.09; 'okay': 0.09; 'pep': 0.09; 'quarter': 0.09; 'scheme.': 0.09; 'python': 0.11; 'stored': 0.12; '(also': 0.16; 'character.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'integers.': 0.16; 'lazily': 0.16; 'saying.': 0.16; 'unicode,': 0.16; 'unicode.': 0.16; 'ways:': 0.16; 'where?': 0.16; 'files.': 0.16; 'wrote:': 0.18; '(not': 0.18; 'pointed': 0.19; 'thu,': 0.19; '(the': 0.22; '>>>': 0.22; 'memory': 0.22; 'coding': 0.22; 'proposed': 0.22; 'byte': 0.24; 'bytes': 0.24; 'world,': 0.26; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'fixed': 0.29; 'character': 0.29; 'points': 0.29; 'quickly': 0.29; 'characters': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; '(maybe': 0.31; '25,': 0.31; 'yes.': 0.31; 'critical': 0.32; 'figure': 0.32; 'another': 0.32; 'url:python': 0.33; 'link.': 0.33; 'something': 0.35; 'editor': 0.35; 'no,': 0.35; 'received:google.com': 0.35; 'google': 0.35; 'there': 0.35; 'scheme': 0.36; 'half': 0.37; 'two': 0.37; 'email addr:python.org': 0.37; 'clear': 0.37; 'step': 0.37; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'that,': 0.38; 'pdf': 0.39; 'to:addr:python.org': 0.39; 'called': 0.40; 'how': 0.40; 'even': 0.60; 'skip:u 10': 0.60; 'is.': 0.60; "you're": 0.61; 'information': 0.63; 'name': 0.63; 'more': 0.64; 'email name :python-list': 0.65; 'series': 0.66; 'between': 0.67; 'rendering': 0.68; 'fact,': 0.69; 'jul': 0.74; 'paper': 0.75; 'click': 0.77; 'confusing': 0.84; 'difference.': 0.84; 'exercise.': 0.84; 'fonts': 0.84; "they'd": 0.84; 'url:lang': 0.84; 'usage.': 0.84; 'step.': 0.91; 'why?': 0.91; 'engines,': 0.93; 'refuse': 0.93; 'sheet': 0.93; 'suited': 0.93; '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=bzLHq8eiiMmsU5GGrRSivpVsM6SkEtjObmLmP5xDYSw=; b=oSnxkbdgMW5l1xFQIeiUQuEvL8gmwXGD/s1hPNhEaAkewGHUOUDXIuXuDF1E+xv/tw 4pfTKcWNrOX/2GKFou5+dq2n0j2zef7fvdl3bUrRapxPJx/HyTbUqMDNXP8gS95eGBdB 3Wp3ftsqYhN4p8Mii+dMlWJk4bfXck3yKqGmrqOma25r9hqBmHOaitYbdDbScrGmWTja SnHD6MV0rjiXcV+Ba2cnwD1Nz5wRWiVGODJ+NVGogjpztEq5wHN7ZdlLyZV+UaTH54aZ etmgrfFGH+aqfbJHhBhuIjovSB9waoyE44g6bcy7a3No6RJX230XDhaw8ng0KI4O9bae yZ4w== MIME-Version: 1.0 X-Received: by 10.52.120.77 with SMTP id la13mr14511020vdb.23.1374747286940; Thu, 25 Jul 2013 03:14:46 -0700 (PDT) In-Reply-To: <0420de60-b9b5-4ac4-ba7b-ca5ac2ca65fe@googlegroups.com> References: <571a6dfe-fd66-42cf-92fc-8b97cbe6e9e4@googlegroups.com> <51DFDE65.5040001@Gmail.com> <4f1067f6-bc99-42ad-9166-37fb228b90e8@googlegroups.com> <0420de60-b9b5-4ac4-ba7b-ca5ac2ca65fe@googlegroups.com> Date: Thu, 25 Jul 2013 20:14:46 +1000 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: 63 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1374747295 news.xs4all.nl 15937 [2001:888:2000:d::a6]:41499 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:51212 On Thu, Jul 25, 2013 at 7:27 PM, wrote: > A coding scheme works with a unique set of characters (the repertoire), > and the implementation (the programming) works with a unique set > of encoded code points. The critical step is the path > {unique set of characters} <--> {unique set of encoded code points} That's called Unicode. It maps the character 'A' to the code point U+0041 and so on. Code points are integers. In fact, they are very well represented in Python that way (also in Pike, fwiw): >>> ord('A') 65 >>> chr(65) 'A' >>> chr(123456) '\U0001e240' >>> ord(_) 123456 > In the byte string world, this step is a no-op. > > In Unicode, it is exactly the purpose of a "utf" to achieve this > step. "utf": a confusing name covering at the same time the > process and the result of the process. > A "utf chunk", a series of bits (not bytes), hold intrisically > the information about the character it is representing. No, now you're looking at another level: how to store codepoints in memory. That demands that they be stored as bits and bytes, because PC memory works that way. > utf32: as a pointed many times. You are already using it (maybe > without knowing it). Where? in fonts (OpenType technology), > rendering engines, pdf files. Why? Because there is not other > way to do it better. And UTF-32 is an excellent system... as long as you're okay with spending four bytes for every character. > See https://groups.google.com/forum/#!topic/comp.lang.python/XkTKE7U8CS0 I refuse to click this link. Give us a link to the python-list@python.org archive, or gmane, or something else more suited to the audience. I'm not going to Google Groups just to figure out what you're saying. > If you are not understanding my "editor" analogy. One other > proposed exercise. Build/create a flexible iso-8859-X coding > scheme. You will quickly understand where the bottleneck > is. > Two working ways: > - stupidly with an editor and your fingers. > - lazily with a sheet of paper and you head. What has this to do with the editor? > There is a clear difference between FSR and ucs-4/utf32. Yes. Memory usage. PEP 393 strings might take up half or even a quarter of what they'd take up in fixed UTF-32. Other than that, there's no difference. ChrisA