[patch] AceSerializer array-like table improvement #503


  • Enhancment
  • Patch
Open
  • drakie created this issue Jul 5, 2019

    Hey,

     

    I made an optimization for serializing table which are array-like, ie. they have incrementing keys starting from 1 and can be iterated using ipairs.

    For these tables we can omit the keys from the serialized result.

     

    the diff can be seen here on github: https://github.com/rubensayshi/WoW-Ace3/pull/1/files

     

    I also have a proper .patch file (from git format-patch), can be found here:

    ``https://gist.github.com/rubensayshi/cf558cfc072583c38901ac409d6e0cc1

  • drakie added the tags Enhancment Patch Jul 5, 2019
  • nevcairiel posted a comment Jul 5, 2019

    Changing the serialization is a big problem for compatibility. If eg. you use this for inter-player communication, and one side has an updated version, they wouldn't be able to talk to each other.

     

    With the shared nature of the libraries, there is also no good way to resolve that, since even installing an other addon with a newer version of the library could break a previously installed one.

     

    If this efficiency is of key importance for you, might I suggest to simply do something like AceSerializer:Serialize(unpack(table)) if you know its an array list, and re-form the table manually on the other end?

  • drakie posted a comment Jul 6, 2019

    hmm, ye I hadn't thought about interoperability of old and new versions of addons....


To post a comment, please login or register a new account.