Comments (9)
@amark Where can I find information on Book?
from gun.
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.
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.
RAD also strangely reads the previously written key again - and writes it out again, unchanged! How useless is that?
from gun.
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.
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.
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.
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.
@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)
- fakeS3 option not being recognised HOT 1
- [Question] setting an empty object does not trigger any event handlers? HOT 4
- [Bug?] wrong key path in error message HOT 1
- [Docs] where is "Gun.chain" documented? HOT 2
- [Docs] are really difficult to use! HOT 4
- are there any recipies how to model data structures properly for Gun? HOT 1
- [Doc] user example is wrong? HOT 2
- [Doc] how can one find the root node of a given user? HOT 2
- [Doc] how can one write encrypted data? HOT 2
- [Doc] is the SEA Quickstart example wrong? HOT 3
- If you put data in a key with one gun instance, then change that data on another gun instance, the first instance will be unable to read the change HOT 5
- Unable to use Array.push inside once() HOT 1
- Loading sea.js with importScripts fails in worker HOT 6
- [Bug] _ev.off() disables the entire .map() listener, rather than the individual item HOT 1
- Silent Failure on Incorrect Certificate and Delayed put HOT 1
- How to deploy gun server by Docker? HOT 4
- [Question] Netx.js support? HOT 1
- Why is the source code so bad? HOT 2
- Can not access docs HOT 2
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 gun.