From 8b0a407072cdc23cb3424e052c947ed1020929d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Tue, 28 Feb 2012 21:40:37 +0100 Subject: [PATCH] Update from Mark Shannon. --- pep-0412.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/pep-0412.txt b/pep-0412.txt index 97168c41c..e49d1cff9 100644 --- a/pep-0412.txt +++ b/pep-0412.txt @@ -149,6 +149,25 @@ implementation are already broken and should be fixed to use the API. The iteration order of dictionaries was never defined and has always been arbitrary; it is different for Jython and PyPy. +Alternative Implementation +-------------------------- + +An alternative implementation for split tables, which could save even more +memory, is to store an index in the value field of the keys table (instead +of ignoring the value field). This index would explicitly state where in the +value array to look. The value array would then only require 1 field for each +usable slot in the key table, rather than each slot in the key table. + +This "indexed" version would reduce the size of value array by about +one third. The keys table would need an extra "values_size" field, increasing +the size of combined dicts by one word. +The extra indirection adds more complexity to the code, potentially reducing +performance a little. + +The "indexed" version will not be included in this implementation, +but should be considered deferred rather than rejected, +pending further experimentation. + References ==========