Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'tree': 0.05; 'dan': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '__lt__': 0.16; 'cc:name:python list': 0.16; 'from:addr:stutzbach': 0.16; 'from:name:daniel stutzbach': 0.16; 'non-trivial': 0.16; 'stutzbach': 0.16; 'type),': 0.16; '\xc2\xa0if': 0.16; 'wrote:': 0.18; 'written': 0.21; 'email addr:gmail.com>': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**1': 0.23; "haven't": 0.24; 'daniel': 0.26; 'header:In-Reply-To:1': 0.27; 'message- id:@mail.gmail.com': 0.30; 'class': 0.32; 'entirely': 0.33; 'objects': 0.35; 'but': 0.35; 'received:google.com': 0.35; "didn't": 0.36; 'method': 0.36; 'similar': 0.36; 'being': 0.38; '(i.e.,': 0.38; 'pm,': 0.38; 'more': 0.64; 'to:addr:gmail.com': 0.65; 'mar': 0.68; 'short,': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=FQl3ZkPfsFu5yrGt5UQr7Zu1oiXWMzOaiRjj9Z+q8eA=; b=VU7G7dtwiJSW4ByFRx+AH7P8/A+e15Et+IAe3ECZ0AQZ+SU7tJU0DOdeL1qTz/mpIs /9iVOf+gNWZE5yDXn8gh7+FhAl7yOnPBLgPEgmX+ipf5v1nnanrvHoHA8hTNI3yFVB5f dLMISJ6x5FWjmGmNBaCxjv7ULdpD4537+IfV59inSZp/Jp0//ng92Z0eS1j7Bjov/A4m qjPws7ww29Uq6fds1+pQ5FP5AiHmadrLTWpPgXfx3UkO1RYNcpbOxa+iIkvoj49Khxqg 6CP5klpvZg3DHbK2k+ljfcTq4ubHaUbKGeYnxNnANyj5yp2lNoiqqWVw1jiKKDgj0bUL RMNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=FQl3ZkPfsFu5yrGt5UQr7Zu1oiXWMzOaiRjj9Z+q8eA=; b=YpIbp55iNdxzW11aYxfbT00/ng5CMlBOg1ql5+yHgE/JZiV6xAPkyKgh4yRVkhmxXp FCFAF1iS3ksyvRcNRxDyBtSqQ51fhYSX5IUmJbcQ4ls5w3aqSZ7UAORYQZ6RlsDw/qCd Zy7kvQNLi1QGeeOokheJ6PNSMofmMXQfduQkPE1PQ4BC3aImTUrJ/0Gh6yHRykR21Pk5 6aRbeRJuSWPRcMILW/iG3CrUXcwJIMArtPStxtObtc9Hj37Gs3ZKH+MaOvr1fhkGju5I sfhbVtIbFX67HSH3Un/kOzWTp1CcXjM2mF4gGszrP1JqbsgculZ6+ERY/bkdQ4CKzMN0 I+sA== X-Gm-Message-State: ALoCoQnn6r1KJT38Ds78CdHF1aNvchbm8uYmvnYRdTpnf+V7Su7y4eGTUPxbFovOp+ONJvVGtSaNFKzhIWYp2miaqn9yRbiqjdNzO5ECmE2GCRoYanSBYajIbHvMtRO+7Q5tnNdxXGliIEqj6h37D0/Ov9y3lQpmfFpiC5L5GCn9vA1y3YYBZ1/1nT2Tav91VfIv/8AvC5aQ9SU8tyAeNQ8H2Vlo+7AYLQ== X-Received: by 10.58.190.99 with SMTP id gp3mr5126067vec.32.1395173961286; Tue, 18 Mar 2014 13:19:21 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <87eh2d3x8h.fsf_-_@elektro.pacujo.net> <87mwgoqy4k.fsf@elektro.pacujo.net> From: Daniel Stutzbach Date: Tue, 18 Mar 2014 13:18:40 -0700 Subject: Re: Balanced trees To: Dan Stromberg Content-Type: multipart/alternative; boundary=047d7b675bf05ce3be04f4e740d8 Cc: Python List , Marko Rauhamaa 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: 43 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1395173969 news.xs4all.nl 2917 [2001:888:2000:d::a6]:33486 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:68515 --047d7b675bf05ce3be04f4e740d8 Content-Type: text/plain; charset=UTF-8 On Tue, Mar 18, 2014 at 12:26 PM, Dan Stromberg wrote: > In short, blist.sorteddict didn't do that well, despite being in C. > blist.blist is written in C, but blist.sorteddict is written in Python on top of blist.blist. It won't perform as well as a class written entirely in C that has similar asymptotic properties. If the objects in the tree are non-trivial (i.e., not a built-in type), the cost of calling the __lt__ method may be more important than the choice of blist vs. AVL tree, but I haven't tested it. -- Daniel Stutzbach --047d7b675bf05ce3be04f4e740d8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On T= ue, Mar 18, 2014 at 12:26 PM, Dan Stromberg <drsalists@gmail.com&g= t; wrote:
In short, blist.sorteddict d= idn't do that well, despite being in C.

=
blist.blist is written in C, but blist.sorteddict is written in Python= on top of blist.blist. =C2=A0It won't perform as well as a class writt= en entirely in C that has similar asymptotic properties. =C2=A0If the objec= ts in the tree are non-trivial (i.e., not a built-in type), the cost of cal= ling the __lt__ method may be more important than the choice of blist vs. A= VL tree, but I haven't tested it.

--
Daniel Stutzbach
--047d7b675bf05ce3be04f4e740d8--