Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use SQLite implement PeerStore to replace current MemoryPeerStore #127

Merged
merged 7 commits into from
Jan 3, 2019

Conversation

jjyr
Copy link
Contributor

@jjyr jjyr commented Dec 25, 2018

No description provided.

@jjyr jjyr requested a review from a team December 25, 2018 13:44
@jjyr jjyr force-pushed the jjyr/sqlite-impl-peerstore branch from 7aef7ba to dc70950 Compare December 25, 2018 13:53
@janx
Copy link
Member

janx commented Dec 25, 2018

so we use both rocksdb and sqlite in ckb?

quake
quake previously requested changes Dec 26, 2018
@jjyr
Copy link
Contributor Author

jjyr commented Dec 26, 2018

Currently, SQLite is only used in peer_store component cause mostly operations in peer_store is scanning query, as a dependency SQLite is lightweight enough(~500 KB) so I think it worth to introduce it.

@jjyr jjyr force-pushed the jjyr/sqlite-impl-peerstore branch from 25831b2 to d162316 Compare December 27, 2018 05:53
@jjyr
Copy link
Contributor Author

jjyr commented Dec 27, 2018

Benchmark result of SqlitePeerStore

insert 100 peer_info    time:   [2.1791 ms 2.1974 ms 2.2209 ms]
                        change: [+0.3935% +4.2485% +7.9868%] (p = 0.02 < 0.05)
                        Change within noise threshold.
Found 10 outliers among 100 measurements (10.00%)
  9 (9.00%) high mild
  1 (1.00%) high severe

insert 1000 peer_info   time:   [21.848 ms 21.912 ms 21.994 ms]
                        change: [-0.3118% +0.9157% +2.0459%] (p = 0.13 > 0.05)
                        No change in performance detected.
Found 8 outliers among 100 measurements (8.00%)
  5 (5.00%) high mild
  3 (3.00%) high severe

insert 100 peer_info on filesystem
                        time:   [11.781 ms 11.886 ms 12.011 ms]
                        change: [-13.163% +0.2431% +16.354%] (p = 0.97 > 0.05)
                        No change in performance detected.
Found 13 outliers among 100 measurements (13.00%)
  5 (5.00%) high mild
  8 (8.00%) high severe

random order 1000 / 8000 peer_info
                        time:   [10.031 ms 10.049 ms 10.069 ms]
                        change: [+2.7850% +3.3214% +3.9228%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe

random order 2000 / 8000 peer_info
                        time:   [17.320 ms 17.365 ms 17.420 ms]
                        change: [+3.1729% +3.6346% +4.0582%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 12 outliers among 100 measurements (12.00%)
  1 (1.00%) low mild
  7 (7.00%) high mild
  4 (4.00%) high severe

random order 1000 / 8000 peer_info on filesystem
                        time:   [16.171 ms 16.324 ms 16.504 ms]
                        change: [+1.2804% +3.5011% +6.9388%] (p = 0.01 < 0.05)
                        Performance has regressed.
Found 7 outliers among 100 measurements (7.00%)
  5 (5.00%) high mild
  2 (2.00%) high severe

@jjyr jjyr force-pushed the jjyr/sqlite-impl-peerstore branch from d162316 to 5e6569d Compare December 28, 2018 06:27
@jjyr jjyr changed the title refactor: use SQLite implement PeerStore to replace current MemoryPeerStore [WIP]refactor: use SQLite implement PeerStore to replace current MemoryPeerStore Dec 29, 2018
@jjyr jjyr changed the title [WIP]refactor: use SQLite implement PeerStore to replace current MemoryPeerStore refactor: use SQLite implement PeerStore to replace current MemoryPeerStore Jan 2, 2019
@jjyr jjyr force-pushed the jjyr/sqlite-impl-peerstore branch 2 times, most recently from 04fa98f to 6eb6b6f Compare January 2, 2019 09:52
@jjyr jjyr force-pushed the jjyr/sqlite-impl-peerstore branch from 6eb6b6f to 6ecd2c9 Compare January 3, 2019 06:49
@jjyr jjyr force-pushed the jjyr/sqlite-impl-peerstore branch from 6ecd2c9 to 1318788 Compare January 3, 2019 09:59
@jjyr jjyr force-pushed the jjyr/sqlite-impl-peerstore branch from 1318788 to 8763d34 Compare January 3, 2019 11:34
@jjyr jjyr merged commit a1bdf98 into develop Jan 3, 2019
@jjyr jjyr deleted the jjyr/sqlite-impl-peerstore branch January 3, 2019 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants