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

[generator] Process locality object on memory for interval index building #70

Merged
merged 1 commit into from
Dec 19, 2019

Conversation

cc-engineering
Copy link
Contributor

Ускорение построения обратных индексов для regions и geo_objects. Обработка геометрии объектов происходит в памяти, а не через промежуточный файл. В пиках, для geo_objects, потребление памяти достигает 140Gb.

Ускорение построения geo_objects_index.locidx в ~12 раз (42m vs 8h)

@cc-engineering cc-engineering force-pushed the generator.locality-object-in-memory branch 4 times, most recently from 859fbe8 to db000c6 Compare December 19, 2019 03:32
covering::LocalitiesCovering localitiesCovering;
while (!coveringsParts.empty())
{
auto & part = coveringsParts.back();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

}

FileReader reader(cellsToValueFile);
DDVector<CellValuePair<uint64_t>, FileReader, uint64_t> cellsToValue(reader);
bool BuildLocalityIndex(std::string const & localityIndexPath,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Параметер covering должен быть первым.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

}

FileReader reader(cellsToValueFile);
DDVector<CellValuePair<uint64_t>, FileReader, uint64_t> cellsToValue(reader);
bool BuildLocalityIndex(std::string const & localityIndexPath,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Возможно стоит переименовать функцию во что-то вроде BuildCoveringIndex

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

covering::GetCodingDepth<BuildingSpec::kDepthLevels>(scales::GetUpperScale());

auto const id = localityObject.GetStoredId();
auto && cells = m_buildingSpec.Cover(localityObject, cellDepth);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Предлагаю переименовать m_buildingSpec в m_BuilderSpec

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

BuildingSpec m_buildingSpec;
};

struct RegionsLocalityIndexBuildingSpec
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RegionsLocalityIndexBuildingSpec -> RegionsIndexBuildingSpec

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

}
};

struct GeoObjectsLocalityIndexBuidingSpec
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GeoObjectsLocalityIndexBuidingSpec -> GeoObjectsIndexBuidingSpec

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

@cc-engineering cc-engineering force-pushed the generator.locality-object-in-memory branch from db000c6 to 1fd232e Compare December 19, 2019 15:09
}
};

using RegionsLocalityIndexBuilder = LocalityIndexBuilder<RegionsIndexBuilderSpec>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RegionsLocalityIndexBuilder > RegionsIndexBuilder

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

сделаю отд. pr

};

using RegionsLocalityIndexBuilder = LocalityIndexBuilder<RegionsIndexBuilderSpec>;
using GeoObjectsLocalityIndexBuilder = LocalityIndexBuilder<GeoObjectsIndexBuilderSpec>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GeoObjectsLocalityIndexBuilder -> GeoObjectsIndexBuilder

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

сделаю отд. pr

@LaGrunge LaGrunge merged commit b924f17 into master Dec 19, 2019
@cc-engineering cc-engineering deleted the generator.locality-object-in-memory branch December 19, 2019 16:23
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.

3 participants