Skip to content

Conversation

@Josipmrden
Copy link
Contributor

@Josipmrden Josipmrden commented Jun 12, 2023

Description

This pull request concerns rewriting the do module and its corresponding methods (do.case and do.when) in C++ for increase of performance

Pull request type

  • Refactoring (no functional changes, no api changes)

######################################

Reviewer checklist (the reviewer checks this part)

Module/Algorithm

  • Core algorithm/module implementation
  • Query module implementation
  • Unit tests -> not needed
  • End-to-end tests
  • Code documentation
  • README short description
  • Documentation on memgraph/docs

######################################

Copy link
Contributor

@antoniofilipovic antoniofilipovic left a comment

Choose a reason for hiding this comment

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

Few minor suggestions, otherwise seems good

@Josipmrden Josipmrden marked this pull request as ready for review June 25, 2023 14:36
@Josipmrden Josipmrden requested a review from Ignition June 26, 2023 10:25

return fmt::format("WITH {}", Join(with_entity_vector, ", "));
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense to use here std::move on node_names


void InsertConditionalResults(const mgp::RecordFactory &record_factory, const QueryResults &query_results) {
for (const auto &row : query_results.results) {
auto result_map = mgp::Map();
Copy link
Contributor

Choose a reason for hiding this comment

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

prefer initialization to assignment:

mgp::Map result_map;

Choose a reason for hiding this comment

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

FYI that is construction, no assignment is involved. see https://godbolt.org/z/8P78MeWrW

Copy link
Contributor

Choose a reason for hiding this comment

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

@Ignition I thought all the time it was an assignment, thanks 👍

@vpavicic
Copy link

@Josipmrden release note pliz

@vpavicic
Copy link

vpavicic commented Jun 28, 2023

@Josipmrden ok?

The conditional_execution module which allows the execution of different queries
depending on certain conditions being met, has been rewritten from Python to C++ to
improve performance.

Copy link
Contributor

@antoniofilipovic antoniofilipovic left a comment

Choose a reason for hiding this comment

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

Looks good to me

@Josipmrden Josipmrden requested a review from Ignition June 29, 2023 15:39
Copy link

@Ignition Ignition left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@antoniofilipovic antoniofilipovic merged commit ce1fdf1 into main Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[BUG] Performance issues in the Python do.case and do.when implementations

5 participants