edz314 / GenuineNarrativeCreator

The project aims to create a system that generates genuine narratives within a text-based RPG game. The core idea is to move beyond simple random text generation and create narratives that feel more natural and engaging for the player.
1 stars 0 forks source link

Improve Caching Mechanisms #27

Open edz314 opened 2 months ago

edz314 commented 2 months ago

Observation: The current narrative generation process is resource-intensive, particularly when involving AI models. Redundant calls to these models are causing performance issues.

Proposed Action:

  1. Implement caching mechanisms to store the results of commonly generated narratives or frequently used ad placements.
  2. Consider using in-memory caching or database caching for persistent storage of frequently accessed data.
  3. Profile the code to identify the most resource-intensive operations and prioritize caching these operations.

Issue Example: Title: Implement Caching to Optimize Narrative Generation Performance

Description:

  1. Introduce caching mechanisms to reduce redundant AI model calls in the narrative generation process.
  2. Profile the current code to identify bottlenecks and prioritize caching for the most resource-intensive operations.
  3. Implement both in-memory and persistent caching as needed, ensuring the system remains performant under load.