• James Long's avatar
    Serialize jdeps class/package dependency graphs to JSON · 97ee7828
    James Long authored
    In-memory representations of the two types of graphs were made
    serializable/deserializable to and from JSON. A new module
    `serialization` has been created to help with this process.
    
    The end result is one .txt file containing the JSON dump of both the
    class and package dependency graphs - more rationale on this format is
    included in the docstring of serialization functions.
    
    The performance of the de/serialization is very acceptable (within
    a second on my machine). The filesize of the output JSON file is ~7MB,
    which I also find acceptable. There are rooms for optimization in the
    JSON structure if the filesize becomes an issue in the future.
    
    Bug: 1081889
    Change-Id: I03061372e0ed94aed62de58f41fb3f363f543b3f
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2219817
    Commit-Queue: James Long <yjlong@google.com>
    Reviewed-by: default avatarHenrique Nakashima <hnakashima@chromium.org>
    Reviewed-by: default avatarMohamed Heikal <mheikal@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#773357}
    97ee7828
serialization_unittest.py 6.1 KB