Giter VIP home page Giter VIP logo

Comments (5)

vasilionjea avatar vasilionjea commented on May 25, 2024

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.

vasilionjea avatar vasilionjea commented on May 25, 2024

Before: { size: '117 kB', memory: '162 kB' }
After: { size: '54 kB', memory: '63.8 kB' }

from lofi-dx.

vasilionjea avatar vasilionjea commented on May 25, 2024

Perform difference encoding for additional reduction in bytes. Example:
Screen Shot 2023-01-14 at 3 09 01 PM

from lofi-dx.

vasilionjea avatar vasilionjea commented on May 25, 2024

Added delta encoding

from lofi-dx.

vasilionjea avatar vasilionjea commented on May 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.