Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed2.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.049 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; 'tree': 0.05; 'granted,': 0.07; 'trees': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'cc:name:python list': 0.16; 'previously,': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'library,': 0.24; '(or': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'generally': 0.29; 'compared': 0.30; 'message-id:@mail.gmail.com': 0.30; 'bunch': 0.31; 'comparison': 0.31; 'faster,': 0.31; 'probably': 0.32; 'cases': 0.33; 'table': 0.34; 'equal': 0.35; 'received:google.com': 0.35; 'url:org': 0.36; 'performance': 0.37; 'pm,': 0.38; 'even': 0.60; 'mentioned': 0.61; 'choose': 0.64; 'more': 0.64; 'different': 0.65; 'between': 0.67; 'mar': 0.68; 'sweet': 0.74; 'actually,': 0.84; 'balanced': 0.84 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 :cc:content-type; bh=vCiCdd0DktK7PGVIo5xTD8MtBG0HwcCfqHv4p1QLYW4=; b=XCKUNXZjlQbpa7FA9SjwYMIxe88sNF2JImThFmfGr+GgBfk1vgz2L02wS5aC456J1h vP9bBYQ/nUTQORfRYvyT/TDxJaPEaoY8iQm9s/j3Eraikm6hqY9q+FVUr9lTHTDzGhbw qBQJgfu0vCrS0Ls4lPTpa7NuIrX3Zq5yq+raeVDybUJUxu+M8wcvtYFtYBNIV7mu+yJB juDIV2RiayHoHMEnQaCv/I1TP8oyEuoMHkpd5/HGiNvJkltHQgSCyVfl4gXNtkmay8mH CJs2PIz3cmRKHS69FWbxVe5pI2qYkfhI7Oje6nA4OcGVgWAfSBWtzZfy/9dweLWg0LFb nq4A== MIME-Version: 1.0 X-Received: by 10.236.139.234 with SMTP id c70mr34627127yhj.26.1394328686724; Sat, 08 Mar 2014 17:31:26 -0800 (PST) In-Reply-To: <87eh2ctmht.fsf@elektro.pacujo.net> References: <87eh2d3x8h.fsf_-_@elektro.pacujo.net> <87eh2ctmht.fsf@elektro.pacujo.net> Date: Sat, 8 Mar 2014 17:31:26 -0800 Subject: Re: Balanced trees From: Dan Stromberg To: Marko Rauhamaa Content-Type: text/plain; charset=ISO-8859-1 Cc: Python List 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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1394328694 news.xs4all.nl 2830 [2001:888:2000:d::a6]:59755 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:68057 On Sat, Mar 8, 2014 at 1:21 PM, Marko Rauhamaa wrote: > If I had to choose between a hash table and AVL (or RB) tree in the > standard library, it would definitely have to be the latter. It is more > generally usable, has fewer corner cases and probably has an equal > performance even in hash tables' sweet spot. Actually, in the performance comparison I mentioned previously, I compared Python dict's to a bunch of different balanced trees and one unbalanced tree. The dictionary was much faster, though granted, it was the only one in C. That URL again: http://stromberg.dnsalias.org/~strombrg/python-tree-and-heap-comparison/2014-01/