Pushing thousands of lines via CLI/expect automation is def not a great idea, no. Putting everything into a file, copying that to the device, and loading from there is generally best regardless. The slowness you refer to is almost certainly just because of how XR handles config application. If I'm following correctly, that seems to be the crux of your question. 

On Thu, Dec 8, 2022 at 6:04 PM Sander Steffann <sander@steffann.nl> wrote:
Hi,

What is the best/most efficient/most convenient way to push large prefix lists or sets to an XR router for BGP prefix filtering? Pushing thousands of lines through the CLI seems foolish, I tried using the load command but it seems horribly slow. What am I missing? :)

Cheers!
Sander

---
for every complex problem, there’s a solution that is simple, neat, and wrong