Skip to content

Api speed improvements#59

Merged
dtdannen merged 7 commits intomainfrom
api_speed_improvements
May 9, 2025
Merged

Api speed improvements#59
dtdannen merged 7 commits intomainfrom
api_speed_improvements

Conversation

@dtdannen
Copy link
Copy Markdown
Owner

@dtdannen dtdannen commented May 9, 2025

No description provided.

@dtdannen dtdannen requested a review from Copilot May 9, 2025 21:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces several enhancements aimed at improving API speed and overall application performance. Key changes include:

  • New utility scripts for processing and analyzing DVM events.
  • Updates to the frontend API polling intervals from 1 second to 60 seconds.
  • Enhancements in API caching and logging configuration, including a memory-aware cache implementation.

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
utility/publish_dvm_announcement_to_nostr.py New utility script for publishing DVM announcements to Nostr.
utility/count_unique_dvm_authors.py New script to count unique DVM authors using batch processing.
utility/count_raw_events.py New script to count total rows in the raw_events table.
utility/count_events_by_kind.py New script to generate AsciiDoc output of event counts by kind.
frontend/dvmdash-frontend/lib/api.ts Updated API refresh intervals for improved performance.
api/src/main.py Enhancements in caching, logging configuration, and API endpoints.
api/requirements.txt Added cachetools dependency.
api/logging_config.json New logging configuration for Uvicorn.
api/Dockerfile.local & api/Dockerfile Updated CMD to use the new log configuration.
Comments suppressed due to low confidence (1)

api/src/main.py:74

  • The eviction condition uses CACHE_GB_LIMIT which is set to 1.0, making the condition equivalent to checking if self.memory_usage + size_estimate exceeds self.memory_threshold. Consider clarifying the intended logic or updating the constant to better reflect the desired eviction threshold.
if (self.memory_usage + size_estimate > CACHE_GB_LIMIT * self.memory_threshold):

@dtdannen
Copy link
Copy Markdown
Owner Author

dtdannen commented May 9, 2025

There's also some utility scripts for generating documentation in this PR as well.

@dtdannen dtdannen merged commit f0c5478 into main May 9, 2025
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