Skip to content

Poor performance of get_subjects() even when using indexing without metadata #940

Description

@wasciutto

I am puzzled by how slow get_subjects() is for me. It takes about 10 seconds to retrieve the subject ids for a 67 subject BIDS directory. This is after some improvement achieved by using a saved index file and not indexing metadata - two of the most common performance enhancement suggestions I see here.

I don't understand why gathering the subject IDs in such a small database wouldn't be almost instantaneous. Meanwhile, when I query for a single subject, the result is as quick as you'd expect.

Here is how I fetch my layout, using version 15.5:

bids_dir = "path/to/my/bids_dir"
database_path = "path/to/my/index"

indexer = BIDSLayoutIndexer(index_metadata=False)

BIDSLayout(
  bids_dir,
  indexer=indexer, database_path=database_path,
  reset_database=refresh
)

Is there some way I can configure the indexer to improve my performance here, or some other solution?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions