It works well sometimes, but other times it is comically slow, and it's hard to detect a pattern. I suggest we start by refactoring the worker to make it update a row at a time rather than a cell at a time and see how far that gets us.
|
def _load_data(get_data, indexes): |
|
"Load a batch of data. This is run in a threadpool." |
|
for index in indexes: |
|
row, column = index.row(), index.column() |
|
try: |
|
item = get_data(row, column) |
|
except Exception: |
|
logger.exception("Error while loading search results") |
|
continue |
|
yield index, item |
It works well sometimes, but other times it is comically slow, and it's hard to detect a pattern. I suggest we start by refactoring the worker to make it update a row at a time rather than a cell at a time and see how far that gets us.
bluesky-widgets/bluesky_widgets/qt/_search_results.py
Lines 23 to 32 in c2edf3c