Skip to content

Parallelize lyrics fetching with ThreadPoolExecutor #46

Description

@shimpeiws

Summary

Currently cli.py fetches lyrics sequentially per song via client.get_lyrics(song). This works fine for small numbers of songs but becomes a significant bottleneck when using --max-songs 50 or higher.

Proposed Approach

  • Use concurrent.futures.ThreadPoolExecutor (or asyncio + aiohttp) for concurrent lyrics retrieval
  • Limit worker count to 3–5 to respect Genius API rate limits
  • Ensure thread-safe access to the lyrics cache

Affected Files

  • src/barscan/genius/client.py
  • src/barscan/cli.py

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions