Using CardFilter.All causes huge hit in performance
See original GitHub issueReported by @techfooninja
I’m primarily using the Board.Cards property, since I’m interested in all cards on the board, regardless of which list they’re in. When I run the following code, it executes relatively quickly (5-10 seconds for the 15-20 boards I care about):
this.trello = new TrelloFactory().Me().Result;
foreach (var board in this.trello.Boards)
{
// board.Cards.Filter(CardFilter.All); // <-- This causes huge perf hit
await board.Cards.Refresh();
}
But if I uncomment the filter line, I hit a massive performance hit, possibly even more than 100x (waiting several minutes and it just finished the first board).
Details:
- Used in a .NET Framework 4.6.2 Console Application on a Windows 10 machine (Version 1809, OS Build 17763.379). I see the same behavior on a Windows Server 2016 machine (Version 1607, OS Build 14393.2906)
- The first board I’m trying this on has 8 lists, about 40 visible cards, and 15 archived cards
- Looking at the Fiddler trace, it looks like the API is returning all of the cards relatively quickly (within a second or two of the default query), but it appears that the parsing/processing of the response is what is getting hung up.
- I’m using a paid Manatee.Trello license
- I downloaded the git repo and referenced it in my project instead of using the nuget package. I’m not really familiar with the library code, so I haven’t been able to debug fully myself. But it looks like there is a lot of time being spent on line 42 of ReadOnlyActionCollection.cs, which is:
internal ReadOnlyActionCollection(Type type, Func<string> getOwnerId, TrelloAuthorization auth)
: base(getOwnerId, auth)
{
_updateRequestType = RequestTypes[type];
EventAggregator.Subscribe(this);
}
Maybe there is a concurrency performance issue with the lock used in EventAggregator.cs on line 58?:
public static void Subscribe(IHandle subscriber)
{
if (subscriber == null) throw new ArgumentNullException(nameof(subscriber));
lock (Handlers)
{
if (Handlers.Any(x => x.Matches(subscriber))) return;
Handlers.Add(new Handler(subscriber));
}
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Issues · cdmdotnet/Manatee.Trello
Using CardFilter.All causes huge hit in performance bug Something's wrong. #299 opened on Apr 30, 2019 by gregsdennis.
Read more >Card filter updates, cards page sorting, checklist copy, and ...
Sort cards page by due date We launched the cards page back in July so you could see all your cards across all...
Read more >Do Performance Air Filters Actually Work? - YouTube
That means it's more efficient, and makes more power. It could also mean the engine pulls in more air, and with more air,...
Read more >Wildcard filter variables | Adobe Workfront - Experience League
Using this variable, you can report on tasks or issues assigned to a specific job role. For example, to see all tasks assigned...
Read more >Insights 3.4.1 Documentation
Insights makes it easy to explore your data so that you can ... Tip: Using a card filter instead of a dataset filter...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Be aware that comments are actions, too. But if you need them I’d suggest refreshing them separately. Trello’s API gets iffy when requesting collections within collections.
No, I don’t need actions, and disabling them did return it back to a reasonable performance for my purposes. Thanks for the workaround!