From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: sqlite3 Date: Mon, 06 Dec 2021 14:07:46 +0100 Message-ID: References: <87tufmjyai.fsf@gnus.org> <875ys2lyt0.fsf@yahoo.com> <16FC4A4D-8846-45B0-9DC3-1B6301CCA08C@mit.edu> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39561"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Po Lu , "larsi@gnus.org" , "emacs-devel@gnu.org" To: Qiantan Hong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 06 14:32:53 2021 Return-path: Envelope-to: ged-emacs-devel@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 1muE6t-000A1L-IR for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Dec 2021 14:32:52 +0100 Original-Received: from localhost ([::1]:53374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muE6r-0006mG-Q4 for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Dec 2021 08:32:49 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57060) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muDij-0005ln-QC for emacs-devel@gnu.org; Mon, 06 Dec 2021 08:07:53 -0500 Original-Received: from mail-oln040092072102.outbound.protection.outlook.com ([40.92.72.102]:63698 helo=EUR03-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muDii-0004AM-2Z for emacs-devel@gnu.org; Mon, 06 Dec 2021 08:07:53 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Iw4q5KNbF9EZlPMJVExvXyoZ4Dxz0f2oqnoyHIY88zyP2cC7OCHIXRRKPdQtyYWv4fNRwlK5+Od8cXtL5gM8dhnwy/4ebmdkCKV2dxt+V52omjxpM33Vj+LBFWrodZEt/SjhTAiwhnc+XmyvgBfXsktcacLl+2uKlzKa8gxVNsizfGEUPQ7YjdJsFQWmeE//uoHscQNpLMg3wLhIfcZFzO3B966lIr8VRZT7d33b7TOJZLsxlZLodPJZQHiuSX3TkMRjSNrY3VtsTJDGU8c+dSaxsMplv3zU0rpalTmX2x3fvqkiir+6v0Pthx0sgkTq4nKkMeAKnGeXcEmCNkmOdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GPbZHK/7SETuh3l2igiATq7WRCsVS1tBr0aREsxBAPs=; b=XcYd30Sn1JghpsHiuNnNBJeUultWdGG/99vZgEZBA/05eOsBwdc0WbhFxa2DVDQ6sVQ0Ha7E9c1gZ4WTndavPtpyLl0AT8wkD1s5CIIshGkBla9fvSZb3TvUkvmkGlSHJKaSTVrDdjAsJMIDwajT0Z3aZ/rhdWkPxQ/kIDJ42oihvcCgwKIshqjwq4wEEBpsn3aJsyh/yq6zmv6pgUT6Wdi4t8L8sHVml+YC5/dOgdecoNh30nuEDsHV4rROQS8x0A41UKaI9oAVkF4MQ2Rlhm3TtuZBN7EBRJ4GcfLi25p6+YqcneoUZGozeXa5qA5okxnxmynxZ8TS2V+HKAzZsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GPbZHK/7SETuh3l2igiATq7WRCsVS1tBr0aREsxBAPs=; b=muMgUVnSVpstMYaueIwG1suV87Ezk0O2qj1txldLcne1cF4ZoE9xFV7Z7BRgt9r6GMLpMtf8VqAEtKQtaUubBt+pd1Ts3zCmTJ/Qwsii6XQmQzG+B/ok7rvd0quLnmjB91IOuJp3pmhUrrtsHEl/gm3rQY5b+FpJ9oGYrLWGbdGn6GzvSD0UIbIVjKL++JVNCzvib4kaFF4PKns9HTBdc9JEwL0n04AYXJWIcc8Jd2iLKOOLDPODBDooWhKaonrhXqYhoOsCqoxfgbN2iD4dJodd+N1cwKi/lVLwors8NWOhLv1xgDjjApuTKv2EAhjjih9b7hcy7GuiAsR4TTVe6A== Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) by AM0PR09MB2353.eurprd09.prod.outlook.com (2603:10a6:208:de::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23; Mon, 6 Dec 2021 13:07:47 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::b012:5fd9:9447:d64a]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::b012:5fd9:9447:d64a%4]) with mapi id 15.20.4755.021; Mon, 6 Dec 2021 13:07:47 +0000 In-Reply-To: <16FC4A4D-8846-45B0-9DC3-1B6301CCA08C@mit.edu> (Qiantan Hong's message of "Mon, 6 Dec 2021 12:42:13 +0000") X-TMN: [UiuQ4lpqyclTNYb498zxvLlinkYTDsPJ] X-ClientProxiedBy: AS9PR06CA0091.eurprd06.prod.outlook.com (2603:10a6:20b:465::9) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87zgpdankt.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (81.232.177.30) by AS9PR06CA0091.eurprd06.prod.outlook.com (2603:10a6:20b:465::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.16 via Frontend Transport; Mon, 6 Dec 2021 13:07:46 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2567dbfd-dff2-4173-29bd-08d9b8b96604 X-MS-TrafficTypeDiagnostic: AM0PR09MB2353:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b4rtfFrUAAedrnxMx74Cetj6ytMR40Upyyg4+6+wFxl69DAHvRMEC0Y+K+uA5r36jAdjebOqnRLfLyIVhwgcu6SaHoqvsK2Tn0S/DzatXHdE0zdPIFM1LtYfEwsCoGLyV7Y0Z+lt9gvH7AvbPuIfsYZRzxYxvA23NuNMMsC1MIaOC40/3lWZpSjD/rlDDo/09+5ty6/cebK6siPWP4GT7vRGGgBQDJxnaZG77CgBwXZcWgm/Wn6b8W3yXkJio5EKpRLg9Qz0/S3bkg/t1H99Plkbod5utzzk1EYa5mSw+sBduJKoDGxz+m5q3ypVnVjcbzaDBkvd+12gZTbonvLvu/DQsA3nPATJu2+o6Yutk0hdB9Ab9wUoeVAVDx/unc4w+6C3FI03GGSIYUHqbIHZuMwmLz3Qfct2WfFD0mqWvIekxSk0Cy3mEZ5C8OevAjg0mSwf/h1xpdcFxeXQyXk8sV15ahFwhwxU3kSIygfxhvdIUkZD92zPmsF6IU9CrJEWvkMi9KxMFtmUogd481X57ZSc13NDL10GV9JAjBDJSucE8Sfmv4OzahAwCnhSjAHpn8h68TznLiy64BTrB1taHw== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?fH/Dr0X1b3o4ROwIDx+MotZ1CbW4IfLVRMtKt/z+5RbJ+Ktpb3uQe2fcrD1P?= =?us-ascii?Q?zExRD/H4bo+Oze7udIzGl081A0A9RT3Dqb+s3s7YlBmgzW8rRK55eMw7M5Bh?= =?us-ascii?Q?+8wmuMdSjhnxGft5j703EMGhpT5BapMf8tWdnWZswXXdYnmBUI3c/u/6zzbC?= =?us-ascii?Q?T5IlncEHs+2PuE9OI7ahgVi2W0JMS9Fylw1Tgiae4CJkJEPH9CfEZUHcfqEa?= =?us-ascii?Q?lfCt/qTdZXVs8kEMFNX5ELSvQZ5feTVO4awkTKNZkyLSgem9Qz3q3lAIIR4A?= =?us-ascii?Q?iMJSWW/ngIyExqzEs9jFiSWByMLWyfdEDUkL7fckVD5eh+zslLlK9ktFfs8/?= =?us-ascii?Q?rEoVyUsGWoqpnbjeiNNEnE/snsTmbNwWvvpDJ0mwtezvwxuWEYiOn7LHgx2m?= =?us-ascii?Q?Cr1m6rKO0/qaa+HSPWsZlU9jUw8jrpYSA6c+YPX+9xbdTc7dlWQdWpGSMTom?= =?us-ascii?Q?hRR68DprFX8M2d6wszMh/b3l2Bu8DkWU0Nhd5fhzf+jFe4N+CfBvaVAldFvh?= =?us-ascii?Q?JY5MKznwqgKTvg5A3S64FnhfCanQj+KxlUMMWh5kYZptrugDIYkemuEVyNeB?= =?us-ascii?Q?GtryOZmGkKwsqgTcJxBoKjePz0UjztiIa/eMQ9VgtBhGXxWMxxJffVhR7lnz?= =?us-ascii?Q?c6 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-64da6.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 2567dbfd-dff2-4173-29bd-08d9b8b96604 X-MS-Exchange-CrossTenant-AuthSource: AM9PR09MB4977.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2021 13:07:47.4632 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR09MB2353 Received-SPF: pass client-ip=40.92.72.102; envelope-from=arthur.miller@live.com; helo=EUR03-VE1-obe.outbound.protection.outlook.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, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:281100 Archived-At: Qiantan Hong writes: >> I suggested hashmap serialzied to/from file. I used such approach myself for >> key-value pairs. It worked fine for me, it was quite simple to read/write >> it. Currently I am testing a thing, and I use just assoc list to read/write it >> to a file, and it works fine for me too. > Did you do it in one-batch, or do you do it incrementally (aka only write the > delta?). AFAIK the former is currently basically the standard practice > (printing/reading an alist or sth similar), and it can get too slow if > the key value map gets large. > I just printed out everything at startup and end of application in a batch. But that could be definitely done incrementaly in idle timer or something. Also one could add notify watch so if it changed on disk outisde of emacs, it would be auto reloaded.