none
Table.Buffer, List.Buffer, Binary.Buffer.... RRS feed

  • Question

  • Why are there multiple Buffer functions like Table.Buffer, List.Buffer, Binary.Buffer? Wouldn't something like Value.Buffer be sufficient and more encompassing? I say more encompassing because there have been times I have wanted to buffer a primitive value or a record. In those circumstances I have tried something like List.Buffer({Value}){0} but (at least the times I have tried it) I've not then gotten a speed improvement.    

    This sounds like a whinge, but I just want to understand things a bit better. 

    Tuesday, June 12, 2018 7:47 PM

Answers

  • Primitive values and record values are buffered by default. Tables, lists, and binary values are not. These values are reconstructed on every call, so if they need to be called multiple times in a session (e.g. in an iteration), they should be buffered to avoid performance issues.
    • Marked as answer by CamWally Wednesday, June 13, 2018 11:51 AM
    Wednesday, June 13, 2018 12:15 AM

All replies

  • Primitive values and record values are buffered by default. Tables, lists, and binary values are not. These values are reconstructed on every call, so if they need to be called multiple times in a session (e.g. in an iteration), they should be buffered to avoid performance issues.
    • Marked as answer by CamWally Wednesday, June 13, 2018 11:51 AM
    Wednesday, June 13, 2018 12:15 AM
  • Thanks Colin, that's really good to know. 
    Wednesday, June 13, 2018 11:57 AM
  • Hello.
    I have one question that occurred to me while reading this, which is:

    Which one is better to use? I'm using Web.Contents, and later i parse the binaries to json and convert to a table.
    Should i use Binary.Buffer on the binaries retreived by Web.Contents or should i store the whole table in memory with Table.Buffer in a later step?

    Cheers.

    Monday, October 7, 2019 3:08 PM