summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/import_export/fast_hash_serializer_spec.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42GitLab Bot2022-02-181-1/+1
|
* Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42GitLab Bot2022-01-201-1/+1
|
* Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42GitLab Bot2021-11-181-2/+2
|
* Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42GitLab Bot2021-08-191-1/+1
|
* Add latest changes from gitlab-org/gitlab@13-11-stable-eev13.11.0-rc43GitLab Bot2021-04-201-0/+1
|
* Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42GitLab Bot2020-10-211-4/+6
|
* Add latest changes from gitlab-org/gitlab@13-4-stable-eeGitLab Bot2020-09-191-6/+0
|
* Add latest changes from gitlab-org/gitlab@13-2-stable-eeGitLab Bot2020-07-201-9/+1
|
* Add latest changes from gitlab-org/gitlab@13-0-stable-eeGitLab Bot2020-05-201-1/+1
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-03-131-0/+10
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-02-141-4/+4
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-11-261-0/+2
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-11-131-4/+0
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-10-031-1/+6
|
* Improve performance and memory usage of project exportKamil TrzciƄski2019-09-091-0/+272
ActiveModel::Serialization is simple in that it recursively calls `as_json` on each object to serialize everything. However, for a model like a Project, this can generate a query for every single association, which can add up to tens of thousands of queries and lead to memory bloat. To improve this, we can do several things: 1. We use `tree:` and `preload:` to automatically generate a list of all preloads that could be used to serialize objects in bulk. 2. We observe that a single project has many issues, merge requests, etc. Instead of serializing everything at once, which could lead to database timeouts and high memory usage, we take each top-level association and serialize the data in batches. For example, we serialize the first 100 issues and preload all of their associated events, notes, etc. before moving onto the next batch. When we're done, we serialize merge requests in the same way. We repeat this pattern for the remaining associations specified in import_export.yml.