I have a python program that is going to have a lot of memory, primarily in the announcer. This dict will be responsible for assigning a unique integer value to a very large set of keys. Since I work with large matrices, I need a correspondence between the keys, which can also be restored (i.e. as soon as the matrix calculations are finished, I need to match the values ββwith the original keys).
I believe that this amount will ultimately surpass the available memory. I am wondering how this will be handled in relation to swap space. Perhaps a better data structure exists for this purpose.
This will simply end in the swap exchange process because the hash table has very randomized memory access patterns.
If you know that the card exceeds the size of physical memory, you can first use the data structure on the disk. This is especially important if you do not need a data structure during the calculation. When a hash table starts swapping, it also creates problems outside the hash table itself.
You need a database if the data exceeds memory. Indexing dictionaries is not designed for good performance when the dictionary has more memory.
- (python).
dict , redis, . , , :)
, dict, C malloc. , malloc . malloc , , , , . Python MemoryError, malloc , . , dict . - .
Source: https://habr.com/ru/post/1736382/More articles:How should I index a table for optimization to find zero? - nullAuthenticate MSMQ message with alternate credentials? - authenticationmemmove, memcpy and new - c ++Disable native Soap class in PHP5 and use nuSoap? - phpShow meshes on a grid - c #WPF application crashes after publishing ClickOnce - visual-studio-2008Where to Find Free Trading Algorithm Tutorials - algorithmCan I automate a tree hierarchy using Fluent NHibernate? - fluent-nhibernateLike abstract NHibernate to avoid hard addiction and ease testing - abstractionGoogle engine: new version does not appear - pythonAll Articles