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

fix: speed up routes #166

Merged
merged 2 commits into from
Sep 11, 2023
Merged

fix: speed up routes #166

merged 2 commits into from
Sep 11, 2023

Conversation

cabreraalex
Copy link
Member

Description

Various changes to improve performance.

  • Consolidate get routes for state and charts
  • Use await and promises for table and results for consistency

def get_charts(project: str, request: Request):
if not util.access_valid(project, request):
def get_charts(owner_name: str, project_name: str, request: Request):
project_uuid = select.project_uuid(owner_name, project_name)
Copy link
Member

Choose a reason for hiding this comment

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

Can't we do this from the project uuid? Should have this already when fetching charts, no?

backend/zeno_backend/server.py Outdated Show resolved Hide resolved
def get_chart_data(chart: Chart, project: str, request: Request):
if not util.access_valid(project, request):
def get_chart(owner_name: str, project_name: str, chart_id: int, request: Request):
project_uuid = select.project_uuid(owner_name, project_name)
Copy link
Member

Choose a reason for hiding this comment

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

Same as above.

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't necessarily have it. We could wait for the parent layout to resolve, but then it causes a waterfall and is slow.

@cabreraalex cabreraalex merged commit d4688b2 into main Sep 11, 2023
6 checks passed
@cabreraalex cabreraalex deleted the speed branch September 11, 2023 15:08
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