Skip to content

Commit 8951cc7

Browse files
committed
Store changed point table to simple array.
1 parent f3a2f18 commit 8951cc7

File tree

4 files changed

+15
-85
lines changed

4 files changed

+15
-85
lines changed

console/executor_dumps.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ void executor::dump_buckets() const
127127
query_.header_buckets() %
128128
query_.txs_buckets() %
129129
query_.tx_buckets() %
130-
query_.point_buckets() %
131130
query_.spend_buckets() %
132131
query_.prevout_buckets() %
133132
query_.strong_tx_buckets() %
@@ -144,7 +143,6 @@ void executor::dump_collisions() const
144143
(to_double(query_.header_records()) / query_.header_buckets()) %
145144
(to_double(query_.header_records()) / query_.txs_buckets()) %
146145
(to_double(query_.tx_records()) / query_.tx_buckets()) %
147-
(to_double(query_.point_records()) / query_.point_buckets()) %
148146
(to_double(query_.spend_records()) / query_.spend_buckets()) %
149147
(to_double(query_.prevout_records()) / query_.prevout_buckets()) %
150148
(to_double(query_.strong_tx_records()) / query_.strong_tx_buckets()) %

console/executor_scans.cpp

Lines changed: 1 addition & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -190,29 +190,6 @@ void executor::scan_buckets() const
190190

191191
// ------------------------------------------------------------------------
192192

193-
filled = zero;
194-
bucket = max_size_t;
195-
start = logger::now();
196-
while (!cancel_ && (++bucket < query_.point_buckets()))
197-
{
198-
const auto top = query_.top_point(bucket);
199-
if (!top.is_terminal())
200-
++filled;
201-
202-
if (is_zero(bucket % tx_frequency))
203-
logger(format("point" BN_READ_ROW) % bucket %
204-
duration_cast<seconds>(logger::now() - start).count());
205-
}
206-
207-
if (cancel_)
208-
logger(BN_OPERATION_CANCELED);
209-
210-
span = duration_cast<seconds>(logger::now() - start);
211-
logger(format("point" BN_READ_ROW) % (to_double(filled) / bucket) %
212-
span.count());
213-
214-
// ------------------------------------------------------------------------
215-
216193
filled = zero;
217194
bucket = max_size_t;
218195
start = logger::now();
@@ -381,42 +358,6 @@ void executor::scan_collisions() const
381358
strong_tx.clear();
382359
strong_tx.shrink_to_fit();
383360

384-
// point
385-
// ------------------------------------------------------------------------
386-
387-
index = max_size_t;
388-
start = logger::now();
389-
const auto point_buckets = query_.point_buckets();
390-
const auto point_records = query_.point_records();
391-
std_vector<size_t> point(point_buckets, empty);
392-
while (!cancel_ && (++index < point_records))
393-
{
394-
const tx_link link{ possible_narrow_cast<tx_link::integer>(index) };
395-
++point.at(hash(query_.get_point_key(link.value)) % point_buckets);
396-
397-
if (is_zero(index % tx_frequency))
398-
logger(format("point" BN_READ_ROW) % index %
399-
duration_cast<seconds>(logger::now() - start).count());
400-
}
401-
402-
if (cancel_)
403-
logger(BN_OPERATION_CANCELED);
404-
405-
// ........................................................................
406-
407-
const auto point_count = count(point);
408-
span = duration_cast<seconds>(logger::now() - start);
409-
logger(format("point: %1% in %2%s buckets %3% filled %4% rate %5%") %
410-
index % span.count() % point_buckets % point_count %
411-
(to_double(point_count) / point_buckets));
412-
413-
for (const auto& entry: dump(point))
414-
logger(format("point: %1% frequency: %2%") %
415-
entry.first % entry.second);
416-
417-
point.clear();
418-
point.shrink_to_fit();
419-
420361
// spend
421362
// ------------------------------------------------------------------------
422363

@@ -435,7 +376,7 @@ void executor::scan_collisions() const
435376
for (const auto& in: inputs)
436377
{
437378
++total;
438-
++spend.at(hash(query_.to_spend_key(in)) % spend_buckets);
379+
++spend.at(hash(query_.get_spend_key(in)) % spend_buckets);
439380

440381
if (is_zero(index % put_frequency))
441382
logger(format("spend" BN_READ_ROW) % total %

console/localize.hpp

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -110,27 +110,25 @@ namespace node {
110110
" header :%1%\n" \
111111
" txs :%2%\n" \
112112
" tx :%3%\n" \
113-
" point :%4%\n" \
114-
" spend :%5%\n" \
115-
" prevout :%6%\n" \
116-
" strong_tx :%7%\n" \
117-
" valid_tx :%8%\n" \
118-
" valid_bk :%9%\n" \
119-
" address :%10%\n" \
120-
" neutrino :%11%"
113+
" spend :%4%\n" \
114+
" prevout :%5%\n" \
115+
" strong_tx :%6%\n" \
116+
" valid_tx :%7%\n" \
117+
" valid_bk :%8%\n" \
118+
" address :%9%\n" \
119+
" neutrino :%10%"
121120
#define BN_MEASURE_COLLISION_RATES \
122121
"Collision rates...\n" \
123122
" header :%1%\n" \
124123
" txs :%2%\n" \
125124
" tx :%3%\n" \
126-
" point :%4%\n" \
127-
" spend :%5%\n" \
128-
" prevout :%6%\n" \
129-
" strong_tx :%7%\n" \
130-
" valid_tx :%8%\n" \
131-
" valid_bk :%9%\n" \
132-
" address :%10%\n" \
133-
" neutrino :%11%"
125+
" spend :%4%\n" \
126+
" prevout :%5%\n" \
127+
" strong_tx :%6%\n" \
128+
" valid_tx :%7%\n" \
129+
" valid_bk :%8%\n" \
130+
" address :%9%\n" \
131+
" neutrino :%10%"
134132
#define BN_MEASURE_PROGRESS_START \
135133
"Thinking..."
136134
#define BN_MEASURE_PROGRESS \

src/parser.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ parser::parser(system::chain::selection context) NOEXCEPT
8282
configured.database.output_size = 25'300'000'000;
8383
configured.database.output_rate = 5;
8484

85-
// Full size too big for mini, so reduced to compressed size.
86-
configured.database.point_buckets = 546'188'501;
8785
configured.database.point_size = 8'389'074'978;
8886
configured.database.point_rate = 5;
8987

@@ -695,11 +693,6 @@ options_metadata parser::load_settings() THROWS
695693
)
696694

697695
/* point */
698-
(
699-
"database.point_buckets",
700-
value<uint32_t>(&configured.database.point_buckets),
701-
"The number of buckets in the point table head, defaults to '546188501'."
702-
)
703696
(
704697
"database.point_size",
705698
value<uint64_t>(&configured.database.point_size),

0 commit comments

Comments
 (0)