From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2610:1c1:1:606c::19:2]) by sourceware.org (Postfix) with ESMTPS id 412CD385800D for ; Thu, 11 Jan 2024 19:35:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 412CD385800D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=FreeBSD.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 412CD385800D Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2610:1c1:1:606c::19:2 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1705001728; cv=pass; b=CgNF/C1d4AIi7IGgbziJ3R+m7zU6BIAaQVCLMA3P7oYczr1hKNSok8ZaFXi7eQwwpkJ0QaqxzVmj06zt5kklcVBsPP+22zqQVylOUkyUs8H4nIywJ4kHz5Dyxzx7n4r5k9Jqe6t1L0uxVLQUrJsWow8GKrqO7p/phSZP3D4b/q8= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1705001728; c=relaxed/simple; bh=sQCQglHyz4K8cuam7hWVCbAwGwCIK0QKWsPPFSp+n7o=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=Zvz1h6xl6XTe7nr/yAQ6QCjbzSESA8bCtwymgw3SOVXmvtfs6/DCquXM9b9FQvh4m9gJOivDZK/5uY4upZ8EONLOJBBAybLsXUWUBW/FUqgwfhYFXSGq79k2JL/tnL4t+EDoEh6XjTPvRGQrD1PrJlZGHD/C+fIg8QaqC4vZ6xE= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4T9vyk6HXhz3vVG; Thu, 11 Jan 2024 19:35:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T9vyk5N4bz44rH; Thu, 11 Jan 2024 19:35:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705001726; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=urQt5Yhs5gxKV+0CZtAoMs4Rc1YffL8EQRUZaJKFZj0=; b=nQ18IALWbAOh6X/CNIsh3NmiO/LQHKYWtwVqFXe35Q/45XLeCjzjMVnQcDam6x+2lDgb2z CF9d+7qjbpeDJiQfBFdCQR3/1w37UCsxDpxNfpffVQymnHHTbsewaBGomRqtbOqAmXhoFC WuUPwHFSelj/l4rKA4X+0yMVyzoDoYwZfFiSGdDy2wVyw0ByursWI5ouJxFC83O2pIHLpv 3cFiLiTZOLslYBaJwWxijbP1VlX0xc6Kco9ZVU6ycTxlnmmFsAHs96U55pIf5YvgkMTkMi IIcnX62lBqnesAF17SblKYlKaDap7GCVFiGurJZ0XPWoLJLwQAjp9zG5QPHYDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705001726; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=urQt5Yhs5gxKV+0CZtAoMs4Rc1YffL8EQRUZaJKFZj0=; b=S70qcytDVNRx1l+n4stbcG/VX8v5jvqxIvLCS3H7LSrpT1Oi9rFV89ybT2JtWqTYVAqCK/ LvcLZ/Ag+5M3744zTTh2rbD2UlpcTyN2rG05wymLkbw+6E/nsxX1RQdWBQVICbGYavYOHv CL6f6/Wx3AvEE3KY+ZL3SQVDTvEHQ/GAMO7zJugnf1pzOZx7nKjBAWxnyHFauG0EA2vBNd nhIjN5tJVrmiRDxiXl2YbN9NzxSxYerkYQ9zFaJO34pRazqfwJJXrLqvPHIWypb6ZG33kz kPOcADz0BfmWfq8BzBLsz2kuL2x3x8k+FSdwg7RBmB+SK/x5boVAaf0cYFMxRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705001726; a=rsa-sha256; cv=none; b=mzBofRKp8lNJ+GHSDTyCHQsBlP6FgkKoWptBvyOA4jAkezM9y7ngC+KDJ9YHvQevR9YWtV pDWTTB5yTgEOzzE1B96U/NfCw+Ifl8dSbddNsaO7Qtr3FDaXeuqOOys4z9yCFplbE2n6lC x2vg4hyuCynQnSVxPmnezX997OPmJ8xZ5aoA2FuY9szsMk1/+slpAAGq/cSsfluLw4/1X3 Kwmg0Pemcr6InUTLr/G0fOllcKZCfglOHj3pj/XEQecfm0a7tf5NdHqFjpEmtZZqZ+dH50 UKeDm90Vuz+kg5+UDcPQ8iQTm5q5vyGknUdKVybhMNGT1sWsM/OpAUD/ru96zg== Received: from [IPV6:2601:644:9381:f410:7c71:8d88:a2f5:8ee0] (unknown [IPv6:2601:644:9381:f410:7c71:8d88:a2f5:8ee0]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4T9vyk2SDBzRZW; Thu, 11 Jan 2024 19:35:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <50266d7d-aabb-4169-bf42-2f2fa5e89ce7@FreeBSD.org> Date: Thu, 11 Jan 2024 11:35:25 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 00/19] Add hash table to gdbsupport Content-Language: en-US To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20230407-t-robin-hood-hash-v1-0-900d93ef1510@tromey.com> <87jzpoft0q.fsf@tromey.com> <87v87zpwuw.fsf@tromey.com> From: John Baldwin In-Reply-To: <87v87zpwuw.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 1/11/24 10:07 AM, Tom Tromey wrote: >>>>>> "Tom" == Tom Tromey writes: > > [ new hash table ] > > Tom> I'd like to move forward with this. > > Tom> I think most of the patches here are straightforward. The real question > Tom> is whether we want it. I've laid out my rationale in patch #1, with > Tom> some additions (explaining why this is better than unordered_map / > Tom> unordered_set) in a follow-up email. > > I tried converting a few more libiberty hash tables to this one. > > For a lot of things this is fine, big improvement, etc. > > However, this hash table doesn't really admit the possibility that an > element might not have a natural sentinel value. This particularly > comes up with hash maps, where if you want a std::string->whatever map, > you have to introduce some kind of explicit sentinel (in my case I chose > empty string) and also then have to write a trait class. > > So, this is one area where unordered_map has the advantage. Now, it > would be possible to handle this in some way. The hash table could > store a sentinel flag, for instance. Or, we could just accept this > drawback and use unordered_map when convenience is important.> > Anyway, I tend to think it's not an enormous issue, but I figured I'd > point it out. This seems fine to me. -- John Baldwin