Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Dunitrust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
nodes
rust
Dunitrust
Commits
2e01c382
Commit
2e01c382
authored
6 years ago
by
Éloïs
Browse files
Options
Downloads
Patches
Plain Diff
[opti] blockchain-dal: use FnvHashMap for maps with integer key
parent
0f31a10c
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Cargo.lock
+7
-0
7 additions, 0 deletions
Cargo.lock
lib/modules/blockchain/blockchain-dal/Cargo.toml
+1
-0
1 addition, 0 deletions
lib/modules/blockchain/blockchain-dal/Cargo.toml
lib/modules/blockchain/blockchain-dal/src/lib.rs
+4
-3
4 additions, 3 deletions
lib/modules/blockchain/blockchain-dal/src/lib.rs
with
12 additions
and
3 deletions
Cargo.lock
+
7
−
0
View file @
2e01c382
...
@@ -409,6 +409,7 @@ dependencies = [
...
@@ -409,6 +409,7 @@ dependencies = [
"dup-crypto-tests-tools 0.1.0",
"dup-crypto-tests-tools 0.1.0",
"durs-common-tools 0.1.0",
"durs-common-tools 0.1.0",
"durs-wot 0.8.0-a0.9",
"durs-wot 0.8.0-a0.9",
"fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"id_tree 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"id_tree 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rust-tests-tools 0.1.0",
"rust-tests-tools 0.1.0",
...
@@ -594,6 +595,11 @@ name = "fake-simd"
...
@@ -594,6 +595,11 @@ name = "fake-simd"
version = "0.1.2"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "fnv"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
[[package]]
name = "foreign-types"
name = "foreign-types"
version = "0.3.2"
version = "0.3.2"
...
@@ -1479,6 +1485,7 @@ dependencies = [
...
@@ -1479,6 +1485,7 @@ dependencies = [
"checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2"
"checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2"
"checksum failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1"
"checksum failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1"
"checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
"checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3"
"checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
"checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
"checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
"checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
"checksum fuchsia-cprng 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "81f7f8eb465745ea9b02e2704612a9946a59fa40572086c6fd49d6ddcf30bf31"
"checksum fuchsia-cprng 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "81f7f8eb465745ea9b02e2704612a9946a59fa40572086c6fd49d6ddcf30bf31"
...
...
This diff is collapsed.
Click to expand it.
lib/modules/blockchain/blockchain-dal/Cargo.toml
+
1
−
0
View file @
2e01c382
...
@@ -15,6 +15,7 @@ dubp-documents= { path = "../../../tools/documents" }
...
@@ -15,6 +15,7 @@ dubp-documents= { path = "../../../tools/documents" }
duniter-module
=
{
path
=
"../../../core/module"
}
duniter-module
=
{
path
=
"../../../core/module"
}
durs-common-tools
=
{
path
=
"../../../tools/common-tools"
}
durs-common-tools
=
{
path
=
"../../../tools/common-tools"
}
durs-wot
=
{
path
=
"../../../tools/wot"
}
durs-wot
=
{
path
=
"../../../tools/wot"
}
fnv
=
"1.0.6"
id_tree
=
"1.3.0"
id_tree
=
"1.3.0"
log
=
"0.4.*"
log
=
"0.4.*"
rustbreak
=
{
version
=
"2.0.0-rc3"
,
features
=
[
"bin_enc"
]}
rustbreak
=
{
version
=
"2.0.0-rc3"
,
features
=
[
"bin_enc"
]}
...
...
This diff is collapsed.
Click to expand it.
lib/modules/blockchain/blockchain-dal/src/lib.rs
+
4
−
3
View file @
2e01c382
...
@@ -58,6 +58,7 @@ use dubp_documents::{BlockHash, BlockId, Blockstamp, PreviousBlockstamp};
...
@@ -58,6 +58,7 @@ use dubp_documents::{BlockHash, BlockId, Blockstamp, PreviousBlockstamp};
use
dup_crypto
::
hashs
::
Hash
;
use
dup_crypto
::
hashs
::
Hash
;
use
dup_crypto
::
keys
::
*
;
use
dup_crypto
::
keys
::
*
;
use
durs_wot
::
data
::{
rusty
::
RustyWebOfTrust
,
NodeId
};
use
durs_wot
::
data
::{
rusty
::
RustyWebOfTrust
,
NodeId
};
use
fnv
::
FnvHashMap
;
use
rustbreak
::
backend
::{
FileBackend
,
MemoryBackend
};
use
rustbreak
::
backend
::{
FileBackend
,
MemoryBackend
};
use
rustbreak
::
error
::{
RustbreakError
,
RustbreakErrorKind
};
use
rustbreak
::
error
::{
RustbreakError
,
RustbreakErrorKind
};
use
rustbreak
::{
deser
::
Bincode
,
Database
,
FileDatabase
,
MemoryDatabase
};
use
rustbreak
::{
deser
::
Bincode
,
Database
,
FileDatabase
,
MemoryDatabase
};
...
@@ -78,7 +79,7 @@ use crate::writers::transaction::DALTxV10;
...
@@ -78,7 +79,7 @@ use crate::writers::transaction::DALTxV10;
/// Currency parameters (Protocol V10)
/// Currency parameters (Protocol V10)
pub
type
CurrencyParamsV10Datas
=
(
CurrencyName
,
BlockV10Parameters
);
pub
type
CurrencyParamsV10Datas
=
(
CurrencyName
,
BlockV10Parameters
);
/// All blocks of local blockchain indexed by block number
/// All blocks of local blockchain indexed by block number
pub
type
LocalBlockchainV10Datas
=
HashMap
<
BlockId
,
DALBlock
>
;
pub
type
LocalBlockchainV10Datas
=
Fnv
HashMap
<
BlockId
,
DALBlock
>
;
/// Forks tree meta datas (block number and hash only)
/// Forks tree meta datas (block number and hash only)
pub
type
ForksTreeV10Datas
=
entities
::
fork_tree
::
ForkTree
;
pub
type
ForksTreeV10Datas
=
entities
::
fork_tree
::
ForkTree
;
/// Forks blocks referenced in tree indexed by their blockstamp
/// Forks blocks referenced in tree indexed by their blockstamp
...
@@ -90,9 +91,9 @@ pub type WotDB = RustyWebOfTrust;
...
@@ -90,9 +91,9 @@ pub type WotDB = RustyWebOfTrust;
/// V10 Identities indexed by public key
/// V10 Identities indexed by public key
pub
type
IdentitiesV10Datas
=
HashMap
<
PubKey
,
DALIdentity
>
;
pub
type
IdentitiesV10Datas
=
HashMap
<
PubKey
,
DALIdentity
>
;
/// Memberships sorted by created block
/// Memberships sorted by created block
pub
type
MsExpirV10Datas
=
HashMap
<
BlockId
,
HashSet
<
NodeId
>>
;
pub
type
MsExpirV10Datas
=
Fnv
HashMap
<
BlockId
,
HashSet
<
NodeId
>>
;
/// Certifications sorted by created block
/// Certifications sorted by created block
pub
type
CertsExpirV10Datas
=
HashMap
<
BlockId
,
HashSet
<
(
NodeId
,
NodeId
)
>>
;
pub
type
CertsExpirV10Datas
=
Fnv
HashMap
<
BlockId
,
HashSet
<
(
NodeId
,
NodeId
)
>>
;
/// V10 Transactions indexed by their hashs
/// V10 Transactions indexed by their hashs
pub
type
TxV10Datas
=
HashMap
<
Hash
,
DALTxV10
>
;
pub
type
TxV10Datas
=
HashMap
<
Hash
,
DALTxV10
>
;
/// V10 Unused Transaction Output (=sources)
/// V10 Unused Transaction Output (=sources)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment