collections-cache 0.3.3.20250303__py3-none-any.whl → 0.3.4.20250419__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -126,6 +126,7 @@ class Collection_Cache:
126
126
 
127
127
  def get_key(self, key: str):
128
128
  """Used to obtain the value stored by the key"""
129
+ self.get_all_databases()
129
130
  self.verify_size_of_temp_queue("get_key")
130
131
  try:
131
132
  database_to_search = self.keys_databases[key]
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: collections-cache
3
- Version: 0.3.3.20250303
3
+ Version: 0.3.4.20250419
4
4
  Summary: collections-cache is a Python package for managing data collections across multiple SQLite databases. It allows efficient storage, retrieval, and updating of key-value pairs, supporting various data types serialized with pickle. The package uses parallel processing for fast access and manipulation of large collections.
5
5
  License: MIT
6
6
  Author: Luiz-Trindade
@@ -9,6 +9,7 @@ Requires-Python: >=3.12,<4.0
9
9
  Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
12
13
  Description-Content-Type: text/markdown
13
14
 
14
15
  # collections-cache 🚀
@@ -95,6 +96,31 @@ print(f"Inserted {len(cache.keys())} keys successfully!")
95
96
 
96
97
  ---
97
98
 
99
+ ## Performance Benchmark 📊
100
+
101
+ After optimizing SQLite settings (including setting `synchronous = OFF`), the library has shown a significant performance improvement. The insertion performance has been accelerated dramatically, allowing for much faster data insertions and better scalability.
102
+
103
+ ### Benchmark Results
104
+
105
+ For **100,000 insertions**:
106
+
107
+ - **Previous performance**: ~797 insertions per second.
108
+ - **Optimized performance**: **~6,657 insertions per second** after disabling SQLite's synchronization (`synchronous = OFF`), reducing the total insertion time from 125 seconds to **15.02 seconds**.
109
+
110
+ ### Performance Scaling
111
+
112
+ With the optimized configuration, the library scales nearly linearly with the number of CPU cores. For example:
113
+
114
+ - **4 cores**: ~6,657 insertions per second.
115
+ - **8 cores**: ~13,300 insertions per second.
116
+ - **16 cores**: ~26,600 insertions per second.
117
+ - **32 cores**: ~53,200 insertions per second.
118
+ - **128 cores**: ~212,000 insertions per second (theoretically).
119
+
120
+ *Note: Actual performance may vary depending on system architecture, disk I/O, and specific workload, but benchmarks indicate a substantial increase in insertion rate as the number of CPU cores increases.*
121
+
122
+ ---
123
+
98
124
  ## API Overview 📚
99
125
 
100
126
  - **`set_key(key, value)`**: Stores a key–value pair. Updates the value if the key already exists.
@@ -106,17 +132,6 @@ print(f"Inserted {len(cache.keys())} keys successfully!")
106
132
 
107
133
  ---
108
134
 
109
- ## Performance Benchmark 📊
110
-
111
- On a machine with 4 real CPU cores, benchmarks indicate around **781 insertions per second**. The library is designed to scale nearly linearly with the number of real cores. For example:
112
- - **6 cores**: ~1,171 insertions per second.
113
- - **16 cores**: ~3,125 insertions per second.
114
- - **128 cores**: ~25,000 insertions per second (theoretically).
115
-
116
- *Note: Actual performance will depend on disk I/O, SQLite contention, and system architecture.*
117
-
118
- ---
119
-
120
135
  ## Development & Contributing 👩‍💻👨‍💻
121
136
 
122
137
  To contribute or run tests:
@@ -0,0 +1,6 @@
1
+ collections_cache/__init__.py,sha256=uUp8lhp-HnZRumnU_8MT6qVq95t0pOzn7oLW7ARbnvc,48
2
+ collections_cache/collections_cache.py,sha256=mUj52BXn3G2r6Ln9vhpveECuHT55Hc9nYU4kgVdgycY,6420
3
+ collections_cache-0.3.4.20250419.dist-info/LICENSE,sha256=RAIL-FmXSiNRgyiVlfhm2SvVI4XDVsN0jDt9207SJ8o,1168
4
+ collections_cache-0.3.4.20250419.dist-info/METADATA,sha256=faDp84_g113TlR-CQVl-1zvj09WCuFtjD_UbztR5XOY,5770
5
+ collections_cache-0.3.4.20250419.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
6
+ collections_cache-0.3.4.20250419.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.0
2
+ Generator: poetry-core 2.1.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,6 +0,0 @@
1
- collections_cache/__init__.py,sha256=uUp8lhp-HnZRumnU_8MT6qVq95t0pOzn7oLW7ARbnvc,48
2
- collections_cache/collections_cache.py,sha256=IuHDhrQlCqX4oC3s7cwJ-spWI28O3uQ4_IZJtdUtLPE,6387
3
- collections_cache-0.3.3.20250303.dist-info/LICENSE,sha256=RAIL-FmXSiNRgyiVlfhm2SvVI4XDVsN0jDt9207SJ8o,1168
4
- collections_cache-0.3.3.20250303.dist-info/METADATA,sha256=uxdp9Cfyq-kSHofaNjjKfCa3hk0OBRk73x0XcLH8Z_g,4993
5
- collections_cache-0.3.3.20250303.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
6
- collections_cache-0.3.3.20250303.dist-info/RECORD,,