Issue 14635 in skia: SkSL: remove ModifiersPool

0 views
Skip to first unread message

johns… via monorail

unread,
Jul 23, 2023, 10:01:40 AM7/23/23
to bu...@skia.org
Status: Accepted
Owner: johns...@google.com
Area: SkSL
Priority: Low
Type: Idea

New issue 14635 by johns...@google.com: SkSL: remove ModifiersPool
https://bugs.chromium.org/p/skia/issues/detail?id=14635

Most places where modifiers are used do not actually require Layout, but some do need both (global variables, interface blocks, interface block fields).

Modifier flags are only 4 bytes (sizeof int), but Layout is 40 bytes. However, Modifiers and Layout currently share one struct; we can't have one without the other.

This was previously recognized as a waste of space, so Modifiers were pooled into a hash set. This reduced the cost of Modifiers to sizeof(pointer), still generally larger than sizeof(int).

It seems like a better design would be:
- Separate Modifiers and Layout so that they don't share a single struct
- Remove Layout from the places which don't use it. The only places which should need it are (I think) global variables, interface blocks and IB fields.
- Remove ModifiersPool

This seems like it would be an overall win--code size down, memory usage roughly flat, performance possibly up, get rid of the modifiers pool.

It would not be a huge savings but it reduces overall complexity.

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

johns… via monorail

unread,
Jul 23, 2023, 10:07:34 AM7/23/23
to bu...@skia.org

Comment #1 on issue 14635 by johns...@google.com: SkSL: remove ModifiersPool
https://bugs.chromium.org/p/skia/issues/detail?id=14635#c1

(We might be able to use the existing `ExtendedVariable` class to handle this.)
Reply all
Reply to author
Forward
0 new messages