commit | b2e692629c1fb19342517d7fb61f1cf83d075492 | [log] [tgz] |
---|---|---|
author | Kaylee Lubick <kjlubick@google.com> | Tue Nov 26 13:49:28 2024 -0500 |
committer | SkCQ <skcq-be@skia-corp.google.com.iam.gserviceaccount.com> | Mon Dec 02 16:15:26 2024 +0000 |
tree | 6e57e2e83315e351612def5aa701dc09efbb7684 | |
parent | d4f01d5608531132431aaccb4d6c05de03ae623e [diff] |
Re-arrange struct layouts to reduce in-memory size of public types Full measurements before [1] and after [2] Savings: - skcms_ICCProfile: 1016 -> 976 bytes (-40 bytes; 3.7%) - skcms_A2B: 416 -> 400 bytes (-16 bytes; 3.8%) - skcms_B2A: 408 bytes -> 400 bytes (-8 bytes; 1.9%) I found these by inspecting the output of bazel build //:skcms_public --copt "-Xclang -fdump-record-layouts -Wpadded -Wno-error" There were a few other warnings but re-arranging the structs wouldn't have done anything due to 8 byte alignment. This adds one test that was helpful when debugging an issue I had while creating this CL. [1] http://gpaste/5485377728282624 [2] http://gpaste/6273912634867712 Change-Id: I0ed18f85640537844f0953bda9b6848399968479 Reviewed-on: https://skia-review.googlesource.com/c/skcms/+/924237 Commit-Queue: Kaylee Lubick <kjlubick@google.com> Reviewed-by: Daniel Dilan <danieldilan@google.com> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
To build with ninja, simply run ninja
from the root directory. This will produce a library in /out.
There are also Bazel rules, outlined in BAZEL.md