Skip to content

[#1102] Implementation of the MORK type AdapterDB 2#1121

Closed
marcocapozzoli wants to merge 4 commits into
masterfrom
masc/1102-adapterdb-mork
Closed

[#1102] Implementation of the MORK type AdapterDB 2#1121
marcocapozzoli wants to merge 4 commits into
masterfrom
masc/1102-adapterdb-mork

Conversation

@marcocapozzoli
Copy link
Copy Markdown
Collaborator

Implementation of MorkMappingStrategy and Metta2AtomsMapper


try {
MettaExpression metta_expr{expr};
atoms = this->mapper->map(DbInput{metta_expr});
Copy link
Copy Markdown
Contributor

@andre-senna andre-senna May 27, 2026

Choose a reason for hiding this comment

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

I suppose this call maps the entire Mork Server contents. So you are keeping an extra copy of the atoms vector unecessarily. The container should be passed by reference to map() and be populated there directly.

This comment is coupled with another one regarding line 52 below.

You are crating yet another container (batch_queue) and make yet another copy of everything again.

I'm wondering if you cold create only batch_queue and pass its reference to be populated in mapper->map().

}
#endif

return this->atoms;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Regarding my comments about src/db_adapter/non_sql/mork/MorkWrapper.cc

Here you keep yet another copy of all atoms.

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.

2 participants