Giter Club home page Giter Club logo

Comments (9)

jadbox avatar jadbox commented on May 29, 2024 1

@amark Where can I find information on Book?

from gun.

rozek avatar rozek commented on May 29, 2024

a small note: if I change RAD_write and set the trivialRADStore_Store directly (i.e., avoid to call Rad), the whole loop completes almost immediately - thus, its RAD that cause the problems...

from gun.

rozek avatar rozek commented on May 29, 2024

Ok, my current observations so far:

  • entry "!" seems to collect written entries until they get stored away at their own keys
  • I have no idea what entry "%1C" is good for - indeed I had to suppress reading and writing that entry! (see below)
  • keys get encoded in a strange way: "1/1" becomes "1%2F1"
  • there is no "radix tree" anywhere!
  • entries are stored as JSON strings - but in a really strange format: writing "1/1" to key "1/1" (yes, in my experiments I used the key as value as well) creates an entry at "1%2F1" with the contents {"1/1":{"":"1/1"}}

In order to speed my in-memory(!) store up, I had to change my RAD adpter's code to

  const trivialRADStore_Store = Object.create(null)

  const trivialRADStore = {
    get: function (Key, Callback) {
      console.log('  trivialRADStore: reading', Key)
if (Key === '%1C') { return Callback(null,undefined) }
      return Callback(null,trivialRADStore_Store['' + Key])
    },

    put: function (Key, Data, Callback) {
      console.log('  trivialRADStore: writing', Key, typeof Data)
if (Key === '%1C') { return Callback(null,0) }
      trivialRADStore_Store['' + Key] = Data
      return Callback(null,1)
    }
  }

This is nothing but a hack - however, without that hack, my browser starts slowing down heavily after a few writes...

from gun.

rozek avatar rozek commented on May 29, 2024

RAD also strangely reads the previously written key again - and writes it out again, unchanged! How useless is that?

from gun.

rozek avatar rozek commented on May 29, 2024

I meanwhile set the chunk option to 1 for speedup

Here is a transcript of the first few operations on my in-memory store:

entry #1: 0
   trivialRADStore: reading %1C 0 undefined
   trivialRADStore: reading ! 0 undefined
   trivialRADStore: writing %1C 12 {"!":{"":1}}
   trivialRADStore: writing ! 20 {"0":{"":"value 0"}}
 entry #2: 0/0
   trivialRADStore: reading ! 20 {"0":{"":"value 0"}}
   trivialRADStore: writing %1C 25 {"!":{"":1},"0/0":{"":1}}
   trivialRADStore: writing 0%2F0 24 {"0/0":{"":"value 0/0"}}
   trivialRADStore: writing ! 20 {"0":{"":"value 0"}}
 entry #3: 0/1
   trivialRADStore: reading 0%2F0 24 {"0/0":{"":"value 0/0"}}
   trivialRADStore: writing %1C 41 {"!":{"":1},"0/":{"0":{"":1},"1":{"":1}}}
   trivialRADStore: writing 0%2F1 24 {"0/1":{"":"value 0/1"}}
   trivialRADStore: writing 0%2F0 24 {"0/0":{"":"value 0/0"}}
 entry #4: 0/2
   trivialRADStore: reading 0%2F1 24 {"0/1":{"":"value 0/1"}}
   trivialRADStore: writing %1C 52 {"!":{"":1},"0/":{"0":{"":1},"1":{"":1},"2":{"":1}}}
   trivialRADStore: writing 0%2F2 24 {"0/2":{"":"value 0/2"}}
   trivialRADStore: writing 0%2F1 24 {"0/1":{"":"value 0/1"}}

from gun.

rozek avatar rozek commented on May 29, 2024

well, entry "%1C" seems to contain, what is called the "radix tree": the JSON string of an object with the hierarchy of keys.

I have no idea what that is good for as the get and put calls to my adapter always contain the full key of the affected entry...

from gun.

amark avatar amark commented on May 29, 2024

RAD being replaced with Book, just heads up. So if you're willing to help hack on that instead, please let me know! We do screen calls. @rogowski has been helping.

RAD chunks the tree into pages, so what you're seeing is the pages name and the root file that keeps track of the folder of files. More explained here:

https://youtu.be/5fCPRY-9hkc?t=1275

but note: Book will be replacing this, so don't spend too much time/effort on it.

from gun.

rozek avatar rozek commented on May 29, 2024

That's good to know - I already lost a day on this because I searched the problem on my side...will give up on RAD then!

from gun.

amark avatar amark commented on May 29, 2024

@rozek I'm back to working on Book, was distracted with @SecureRender for a while. Want to help me & Rogowski?

@jadbox same??? Sorry not much docs yet, mostly just ask me on http://chat.gun.eco and maybe look thru tests in tests/rad/book (or... somewhere like that) or jump on a call with me (DM on twitter).

from gun.

Related Issues (20)

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.