whyrusleeping
47c4411477
set map in constructor
2019-05-31 18:31:04 -07:00
Steven Allen
0b5b389640
dep: switch to core ( #80 )
...
* dep: switch to core
Specifically, remove go-libp2p-{crypto,peer} deps.
* catch a few more usages of deprecated packages.
2019-05-31 14:51:16 +01:00
Steven Allen
d2e2c56c66
feat: intern agent versions
...
This also starts taking up a bunch of memory after a while.
2019-05-27 14:41:29 -07:00
Steven Allen
fd3ea885ff
feat: improve protocol interning
...
This used to specify a max size/count but that was only because this logic was
shared between all peerstores (including the on-disk one). Now that:
1. This only applies to the in-memory one.
2. We never actually GC these.
We can just intern indefinitely.
2019-05-27 14:35:05 -07:00
vyzo
28b1a9f31d
don't track segment sizes, it's a fruitless optimization
2019-05-17 23:39:21 +03:00
vyzo
afca355218
index the peer ID strings directly to avoid copying the byte slice
2019-05-17 23:36:46 +03:00
vyzo
d340d2983e
cosmetics
2019-05-17 13:14:39 +03:00
vyzo
a9e3f07759
global interned protocol table
2019-05-17 12:47:07 +03:00
vyzo
5ed17f0b79
embed lock in segment
2019-05-17 12:37:46 +03:00
vyzo
08caa87351
refactor protocol functionality into ProtoBook
2019-05-17 12:33:33 +03:00
vyzo
303b1b6207
update segment size on gc
2019-05-09 11:20:12 +03:00
Raúl Kripalani
e7e511ba99
segment the memory peerstore; granular locks.
2019-05-09 00:27:58 +01:00
vyzo
f21f6eac4f
don't eager gc
2019-04-28 16:21:07 +03:00
vyzo
c58ce1f56f
add Close method to memory address book, which cancels the gc process
2019-04-28 12:19:26 +03:00
vyzo
e4cf50160f
periodically schedule gc
2019-04-28 12:17:48 +03:00
vyzo
d0a3cc17f4
don't delete under the read lock
...
let gc clean up the addrs
2019-04-28 11:35:23 +03:00
vyzo
3cd491431b
read/write metadata lock
2019-04-27 22:19:49 +03:00
vyzo
0ddad15bd2
read/write address book lock
2019-04-27 22:19:39 +03:00
Steven Allen
aae59b7403
optimize memory of in-memory peerstore
2019-04-23 00:10:05 -07:00
Adrian Lanzafame
c04ff2d27b
add keybook benchmarks
...
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
2018-11-07 15:48:31 +10:00
Steven Allen
588ab36ce8
update to match new ExtractPublicKey API
...
This is a "more correct" API and we might as well fix this before it becomes
used all over the place. The new API returns ErrNoPublicKey when there is no
inlined key.
This *also* fixes a bug where the datastore-backed keystore would panic if
`ExtractPublicKey` returned `nil, nil`.
2018-10-16 11:31:32 +01:00
Steven Allen
68a73712e1
store expiring addrs by pointer
...
Hopefully, this reduces the space wasted by using maps (see the comment in the
committed code).
2018-10-14 15:11:35 +01:00
Steven Allen
6daee68364
memoryAddrBook: document gc precondition
2018-10-03 17:42:54 -07:00
Steven Allen
e3a2970d93
add garbage collection for in-memory peerstore
...
There are better ways to do this but pausing dialing once an hour likely isn't
going to break anything and is the simplest approach.
2018-10-02 10:49:55 -07:00
Steven Allen
6d5cedf098
revert to storing peer addresses in a map
...
We switched to a slice to reduce the amount of memory the peerstore ended up
taking up unfortunately, this really killed us in allocations. Looking at
go-ipfs profiles, I'm worried that memory fragmentation is killing us so I'd
like to revert to the old behavior.
Note: The real solution here is dealing with "address abusers".
2018-10-01 22:16:08 -07:00
Raúl Kripalani
1b72b920ed
datastore-backed impls of KeyBook and PeerMetadata.
2018-09-28 14:04:52 +01:00
Raúl Kripalani
4e0c2169c7
Resolve TODO.
2018-09-12 13:42:26 +01:00
Raúl Kripalani
1b410c7294
Merge branch 'master' into txndatastore
2018-09-11 14:13:14 +01:00
Raúl Kripalani
1c25f160a1
normalise import aliases.
2018-09-07 18:46:23 +01:00
Raúl Kripalani
171f051aa1
add tests for keybook; []peer.ID => peer.IDSlice.
2018-09-07 13:04:14 +01:00
Raúl Kripalani
d79386365e
rename NewPeerstoreWith(...) => NewPeerstore(...); adjust godoc.
2018-09-05 15:14:57 +01:00
Raúl Kripalani
bc77b649dc
rename AddrMgr => AddrBook elsewhere.
2018-09-05 15:10:18 +01:00
Raúl Kripalani
7f4288fab1
rename package mem => pstoremem.
2018-09-04 18:07:44 +01:00
Raúl Kripalani
1b57c62e3d
increase benchmark coverage; introduce config struct.
...
* benchmark caching and cacheless variants of DS addrbook.
* benchmark peers with 1, 10, 100 addrs.
2018-09-07 17:45:29 +01:00