Forum Discussion
List.Generate performance
Hello community!
I have a function which calls an API and then loops until all data are retrieved. Therefore, I am using List.Generate, however I am experiencing it to be extremely slow. The number of rows i approx 300.000 and it can take more than 10 minutes to retreive!
I have come across the List.Buffer or Table.Buffer which apperarently should enhance the performance, but I don't know where to include it in my query.
Can anyone help? 🙂
ImkeF maybe?
Query:
7 Replies
- mahoneypatMicrosoft Employee
Please see this approach as an alternative. Also, are you able to increase the number of records returned with each web call?
Power BI - Tales From The Front - REST APIs - YouTube
Pat
- Laura_DannisoeFrequent Visitor
Hi
I have tried to watch the alternative in the video, but I am not quite sure how to implement that in my solution. Yes I am increasing the number of records. The limit is different for each endpoint in the API.
I thought that Buffer could decrease the performance time as it takes around 1,5 hours to refresh the report...
- ImkeFCommunity Champion
Hi Laura_Dannisoe ,
a buffer is useful to stop re-evaluating tables or lists that will be referenced multiple times in iterators (like List.Generate, -.Accumulate, -.Transform or Table.AddColumn).
But in your iterator here (List.Generate), there is no direct list or table input (just records or scalars). Therefore you cannot use it here.
Does the function you're calling ("Resumekey_function") reference a table or a list? Then you might want to buffer that in there.
There are other things to watch out for when optimizing performance: Speed/Performance aspects – The BIccountant maybe you find a hint in there.
- Laura_DannisoeFrequent Visitor
Also the approach is using GET to my understanding right? Would prefer POST.