Comments (5)
Before:
{
"national": {
"1": {
"frequency": 7,
"postings": [9,32,1039,1078,1189,1276,1310]
},
"2": {
"frequency": 7,
"postings": [9,23,530,574,611,761,830]
},
"3": {
"frequency": 9,
"postings": [15,42,426,492,659,717,813,855,1008]
}
},
"other": {}
}
After:
{
"national": {
"1": "7/9,32,1039,1078,1189,1276,1310",
"2": "7/9,23,530,574,611,761,830",
"3": "9/15,42,426,492,659,717,813,855,1008",
},
"other": {}
}
Decreased the index size and memory allocation by about 50%. See scripts/index-stats.js
Additional compression can be left to users.
from lofi-dx.
Before: { size: '117 kB', memory: '162 kB' }
After: { size: '54 kB', memory: '63.8 kB' }
from lofi-dx.
Perform difference encoding for additional reduction in bytes. Example:
from lofi-dx.
Added delta encoding
from lofi-dx.
Added base36 encoding on top of delta encoding, which further reduces byte and memory size.
- Original:
'19,42,157,472,685,709,1025,1051,1477,1571,1670,1837,1922,2038,2063,2084,2168'
–> 76 bytes - Delta encoded:
'19,23,115,315,213,24,316,26,426,94,99,167,85,116,25,21,84'
–> 57 bytes - Base36 encoded:
'j,n,37,8r,5x,o,8s,q,bu,2m,2r,4n,2d,38,p,l,2c'
–> 44 bytes
from lofi-dx.
Related Issues (2)
- Maybe publish 📦 to NPM HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lofi-dx.