Skip to content
New issue

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

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

Already on GitHub? # to your account

Optimize iteration in asset_update_bitasset_evaluator #960

Closed
abitmore opened this issue May 24, 2018 · 1 comment
Closed

Optimize iteration in asset_update_bitasset_evaluator #960

abitmore opened this issue May 24, 2018 · 1 comment
Assignees
Labels
1b User Story The User Story details a requirement. It may reference a parent Epic. It may reference child Task(s) 2g Final Review Status indicating the solution passes the test case(s) and is being reviewed for final acceptance. performance

Comments

@abitmore
Copy link
Member

As described in #932 (comment),

For better performance, we can add a "by_backing_asset" index for asset_bitasset_data_object so can iterate through it here, rather then iterating through all bitAssets.

Related code is:

// loop through all assets that have this asset as a backing asset
const auto& idx = d.get_index_type<asset_index>().indices().get<by_type>();
for( auto itr = idx.lower_bound(true); itr != idx.end(); ++itr )
{
const auto& child = *itr;
if ( child.bitasset_data(d).options.short_backing_asset == op.asset_to_update )
{

@abitmore abitmore added this to the Future Non-Consensus-Changing Release milestone May 24, 2018
@jmjatlanta jmjatlanta self-assigned this Jun 4, 2018
@ryanRfox ryanRfox added 1b User Story The User Story details a requirement. It may reference a parent Epic. It may reference child Task(s) 2g Final Review Status indicating the solution passes the test case(s) and is being reviewed for final acceptance. labels Jun 7, 2018
@jmjatlanta
Copy link
Contributor

Fixed by PR# /pull/1019

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
1b User Story The User Story details a requirement. It may reference a parent Epic. It may reference child Task(s) 2g Final Review Status indicating the solution passes the test case(s) and is being reviewed for final acceptance. performance
Projects
None yet
Development

No branches or pull requests

3 participants