[Webkit-unassigned] [Bug 179528] New: The memory consumption of DFG::BasicBlock can be easily reduced a bit

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 10 07:43:06 PST 2017


https://bugs.webkit.org/show_bug.cgi?id=179528

            Bug ID: 179528
           Summary: The memory consumption of DFG::BasicBlock can be
                    easily reduced a bit
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Minor
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: rmorisset at apple.com

I see several ways of doing it:
- Reordering a few fields to reduce padding brings sizeof(BasicBlock) from 3032 to 3016.
- Making Operands a single vector (safe since we never change the number of arguments) instead of 2 reduces the size from 3016 to 2984, and halves the number of memory allocations when both inline buffer overflow, and avoids overflowing in some cases when we have just a bit more locals than 16, but don't have the full 8 arguments, or the reverse. As a bonus, it makes BasicBlocks more readable when printed in the debugger.

This patch includes both of these changes (since the first one is fairly trivial).
No performance change on some quick benchmarks (none was expected, since this just reduces memory pressure a bit)

Another idea (for a possible further patch) would be to merge all five Operands in BasicBlock into a single Operand of a struct with 5 fields (since all Operands share the same number of locals and of arguments). This would reduce memory consumption and allocation more significantly, but would have a risk of harming memory locality depending on the access pattern. It would also be significantly more involved, since it would require fixing every location that uses one of these 5 fields.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20171110/5ceb6966/attachment.html>


More information about the webkit-unassigned mailing list