From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joel Reicher Newsgroups: gmane.emacs.help Subject: Re: Which Elisp data structure is fastest for searching? Date: Fri, 27 Dec 2024 10:03:57 +1100 Message-ID: <86bjwycahu.fsf@gmail.com> References: <86wmfnc66h.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24226"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: Help GNU Emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 27 00:04:45 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tQwuJ-0006Ah-P8 for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 27 Dec 2024 00:04:43 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQwtl-0002tg-Ul; Thu, 26 Dec 2024 18:04:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tQwtk-0002tX-Um for help-gnu-emacs@gnu.org; Thu, 26 Dec 2024 18:04:08 -0500 Original-Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQwtj-0006ko-EQ for help-gnu-emacs@gnu.org; Thu, 26 Dec 2024 18:04:08 -0500 Original-Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-21634338cfdso115301585ad.2 for ; Thu, 26 Dec 2024 15:04:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735254246; x=1735859046; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=IWfUtXGosS7acdHkbZQO+kCEtcrfXBaxLqH+eTsxGEs=; b=O12M4TBo9BeNqIO2M+MdJRKdVpl11p82BSbBVFJYwy+8RYyY1QKWOuzW4+kzop27F2 dffd1AZKnlKCt+RRjnUatWlGmJtigA55JS1LnhTMdcEuLoDyxx7xO+A+iqwo5BD1wzBv xuoEI2OJkzXZGo9+M4IcY6w+3ZU9XObNP28GSQ9tRMHvG4zczcgR8CA5Gav5jvSW+WBu 2RCROfneX33GBAQZU+n3fCSu9QvetMW30pAubp+klKBUdjqTf6EmwJ8QYD5eqj/rScU/ V8mlQNcTsMcuJDdBJfNn4c8t02vUtI+OgxCuifqUdRV3cVx8EmnIUYECfDYrQMPX5zgG MXMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735254246; x=1735859046; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=IWfUtXGosS7acdHkbZQO+kCEtcrfXBaxLqH+eTsxGEs=; b=gTcvL8AqrsXrI/kPsDaKlNFz5LstlTQRow/bz0bK/tZDg+sagr51HVgWMJSLWNGokE N+gw/6TQ3J11R7VpGj8QqbQ6Ip7WpvI5HW1g18pBrYMOQMEkMEng8cuxqEr+eXec3C9b zCtjHjT+mRVPOYcaaZ/BBGVXx3iD3VsguZIJ/UwnqDBP4Ukf+i1DJFvHo23tZQOs9Kfi 5R0Fa3gNzPCmVKg7laTHpWMrMQu+hB9isibjoqbCc/vrjpajrcHDAJh7HlJ30L/REVau h6sTQWPpOoOdhHQf8DfsrYJurBganAxK+UicEYnXVSHVBoydQ75yeuXUQGAYOGZuiffx D8uw== X-Gm-Message-State: AOJu0YyFNcnsKwT+90I28z6QJDQYUybM+fIJ2fEk9TWn3nTZG1omMvBW zWhlP6ikmFXYOnw+cBTvuNf40aj12DuYDWGy1ehyTCGR/XPbaBRlsVmYYFf/ X-Gm-Gg: ASbGncv4taJpD0TcuV2d+uttX8PnYbpQzo8f1+LRgDOP0VoFcW/ywILJhVryWV8cNn3 XZqmOi0+8OLK+Xq3LNKYMUxsxhNff5c/FSayY/5mlbvCmp6zNfHdlAoJvyVc8BfUcf0fZK3YA1D MUcW/DAueJBwzlkbuxbra1SyKXwiqyzT0uQOM28XvudIy3TqtVKN83PruBq1GzkuPZ0hsigX6p0 xKTIoPpIorrCmayhkvvU93gplLKGIJKkmqWienp5AYDxPznjI9+IEvlXv1H8s9/F2fdIyulDuwA 7i+H6uC8xU5o318sPFxaPEAr0UfbbJtxglkhIZ6zDJTP X-Google-Smtp-Source: AGHT+IEn20jKgJRv/WH9sn60Ie2ihiSS11fv3Au7CrXOKIApruvv4KF/PkQWjKAVu3zlBCK5x0Vw9Q== X-Received: by 2002:a17:902:ce01:b0:215:97c5:52b4 with SMTP id d9443c01a7336-219e6f2601emr373495195ad.39.1735254245713; Thu, 26 Dec 2024 15:04:05 -0800 (PST) Original-Received: from LAPTOP-ACR66VVN (139-218-25-158.sta.wbroadband.net.au. [139.218.25.158]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc96e764sm124473005ad.62.2024.12.26.15.04.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Dec 2024 15:04:05 -0800 (PST) In-Reply-To: (Jean Louis's message of "Thu, 26 Dec 2024 11:53:38 +0300") Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=joel.reicher@gmail.com; helo=mail-pl1-x635.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:149010 Archived-At: Jean Louis writes: [...] > As is written in manual that hash table is very fast, I believe > yes, though my search may not be. > > I will use following approach: > > - there will be list or hash with values that are to be > searched, > those values will have their ID, that information will be > prepared for easier searching, like special symbols removed, > only words remaining, maybe even small words could be removed This makes me think you don't yet know what your equality predicate is, and whether your search space is totally or partially ordered, or unordered. I don't think you will be able to choose a data structure until you have these things figured out. > - there will be different hash with accurate information about > the ID, > such as title, URL, description I am not sure you are using the word "hash" the same way "hash table" does, but if I'm right about the above, it doesn't matter, because you must figure those things out first. > That is approach I know. Then I can give relevant information > for website search. > > I wonder if Emacs can remain in memory keeping to answer HTTP > requests, so that I do not load it every time. Yes it can, but I think worrying about that now is a bit like worrying about how long to age the cheese when you haven't even milked the cow. Regards, - Joel