Skip to content

Serious performance issues #12

Open
@andreasanta

Description

@andreasanta

I attempted the compression of objects with more than 5k key->value pairs, and the use of arrays and several iterations slows down the processing terribly.

I would suggest to optimize:

  • contains, use object instead of array
  • unique, same as above, just stick all the keys into an object and then Object.keys()
  • _getKeys, use === undefined instead of hasOwnProperty (line 149)
  • _compressOther, do not use json.parse/stringify, replace the key names in place without going over the whole string

I wanted to use this for a huge number of objects, but it keeps my node cli running forever with just over 4k keys in my object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions