Home

tips for editing large C# program .linq files?

Sometimes I need to edit to edit a file with is around 1k to 10k lines in size. The vast majority of the lines are from an array declaration (data to be imported) like this:

public ImportRow[] Data = new ImportRow[]
{
new ImportRow { [...row of values...] },
new ImportRow { [...row of values...] },
new ImportRow { [...row of values...] },
[repeat a few thousand times]
};

The editing experience in linqpad works great as usual if I remove most of those lines and just leave a few, but if all the lines are present, editing will often block the UI thread for 30 to 90 seconds at a time.

My current workaround is to cut most of the lines out and put them into another text editor while working on the script, then paste them back in when it's time to run, but it'd be ideal if I didn't need to do that. It's not a horrible workaround, but it's annoying enough that I thought I'd ask for some tricks and tips to help. :)

Thanks!

Comments

  • I plan to look into improving editor performance with large files, but this won't be in the short-term. I've not encountered this problem myself because I tend to write scripts such that they parse the original source of the data, but I can see that this isn't always feasible.

    You could try moving the data declarations into 'My Extensions' (temporarily) although I've not tested the performance impact of this.
Sign In or Register to comment.