Forum Discussion

rudisoft's avatar
rudisoft
Frequent Visitor
4 years ago
Solved

List.Contains() is slow 2.0

Hi all,   I'm having a power query on a medium sized table (15k rows, ~30 columns) where I need to iterate through  (working on atlassian jira rest api) like so:   result = Table.ReplaceValue(buf...
  • AlexisOlson's avatar
    4 years ago

    Instead of using Table.Replace, try using Table.AddColumn to define the same thing as a custom column (and then delete the original [Epic Link] column and rename the new custom column to [Epic Link]).

  • AlexisOlson's avatar
    AlexisOlson
    4 years ago

    Both of those seem intuitive to me. Adding a column is often faster than modifying an existing one.

     

    For your second point, buffered_table[issue key] is already in memory as part of buffered_table, so buffering it into memory separately as a list probably(?) doesn't help that much. Since you are using buffered_list in List.Contains for each row, you want it to be as fast as possible and using a distinct version is more efficient. Having the distinct version already computed and explicitly buffered in that form is even better.