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

CTXAPI-2569: Improve extractAssets to minimize memory and CPU consumption #507

Merged
merged 6 commits into from
Mar 26, 2024

Conversation

alahawash
Copy link
Collaborator

@alahawash alahawash commented Mar 21, 2024

The PR focuses on optimizing the extractAssets process, with changes including:

  • using sectionsWithResources instead of SectionsCreated to save only sections that contain resources. We also search the content document for resources in the constructor in order to do it only once per section.
  • sectionsWithResources will be passed from the export_stream.

@alahawash alahawash changed the title Improve extractAssets to minimize memory and CPU consumption CTXAPI-2569: Improve extractAssets to minimize memory and CPU consumption Mar 25, 2024
{ privatesAccessor } = require('@medable/mdctl-core-utils/privates'),
crypto = require('crypto')

class ExportSection {

constructor(content, key = '') {
constructor(content, key = '', sectionsWithResources) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

add sectionsWithResources = [] as default value otherwise it could fail after in the extractAssets.

@alahawash alahawash merged commit 79ddf97 into main Mar 26, 2024
6 checks passed
@alahawash alahawash deleted the bugfix/extractAssets_fix branch March 26, 2024 11:00
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.

None yet

2 participants