![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
JavaScript Set
and Map
native utilities have a maximum key size of 2 ^ 24 (16,777,216). BigBoiSet
and BigBoiMap
preserve the interface methods of the native Set
and Map
, while silently putting the items into bucketed instances of their respective native counterparts. Keys are hashed before bucketing, and therefore do not need to be uniformly distributed in order to be bucketed appropriately.
npm install --save bigboi
or
yarn add bigboi
Except for constructor, same interface as Set
and Map
There are 2 variants of the Set
and Map
available.
import {
BigBoiSetSimple,
BigBoiMapSimple,
BigBoiSetHashed,
BigBoiMapHashed,
}
The Simple variants will simply push items into a Set/Map until there is no room, then move onto the next one, and so on. The lookup process is naive, and will simply go through the buckets of items to check if a given key is present. This means that any given lookup has a worst case of (total items) / (2 ^ 24)
. Bear in mind, lookups happen on reads/checks, but also on insertions, as we don't want to add the same item to multiple different buckets.
Map
or Set
The Hashed variants will hash the keys and get a deterministic and uniformly distributed bucket assignment for each item. This means that there is O(1) reads and writes, allowing this solution to scale to an arbitrarily high number of items limited only by the available memory in the runtime environment.
const bigSet = new BigBoiSetSimple();
// Add elements
for (let i = 0; i < 20_000_000; i++) {
bigSet.add('Hello' + i);
}
// Check if an element exists
bigSet.has('Hello0'); // returns true
// Remove an element
bigSet.delete('Hello0');
// Iterate over elements
bigSet.forEach((value) => {
console.log(value);
});
// Return iterators
bigSet.entries();
bigSet.keys();
bigSet.values();
// Clear
bigSet.clear();
const bigMap = new BigBoiMapSimple();
// Add elements
for (let i = 0; i < 20_000_000; i++) {
bigMap.add('Hello' + i, i);
}
// Get a value at a given key
bigMap.get('Hello0'); // returns 0
// Check if an element exists
bigMap.has('Hello0'); // returns true
// Remove an element
bigMap.delete('Hello0');
// Iterate over elements
bigMap.forEach((value, key) => {
console.log(key, value);
});
// Return iterators
bigMap.entries();
bigMap.keys();
bigMap.values();
// Clear
bigMap.clear();
We welcome contributions! Please see our contributing guidelines for more information.
MIT
FAQs
Big Sets and Big Maps! Get around the 2 ^ 24 item limit in JS Sets and Maps.
The npm package bigboi receives a total of 2 weekly downloads. As such, bigboi popularity was classified as not popular.
We found that bigboi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.