Commit Graph
756 Commits
Author SHA1 Message Date
Greg Bolsinga e35db6bb0f Shrink ASLayout (#1503)
- Shrink the enum. Save 8 bytes. There are 1000s of these in the heap after running Pinterest for 10 minutes.
2019-05-09 07:49:07 -07:00
Adlai Holler 4cd8e82996 ASSignpost: Add support for the os_signpost API, fixes (#1501)
* ASSignpost: Add support for the os_signpost API

- Removes support for colored intervals. These weren't really useful and they aren't part of the signpost api.
- Fixes an issue with range controller interval logging.
- Adds an interval for interface orientation changes.

* Rename

* Support Xcode 9

* Commentary
2019-05-08 19:59:13 -07:00
Greg Bolsinga 6e1600571c Shrink ASEditableTextNode by 16 bytes (#1500)
Just shuffle some BOOLs around and explicitly declare an ivar so it is grouped with the others.
2019-05-07 21:02:03 -07:00
Greg Bolsinga 83389d92e2 Shrink ASCellNode by 8 bytes (#1499)
Group the BOOLs together, since there are only 4 (and there are no other auto-generated ivars that are < 64 bits) this is sufficient and keeps the properties `atomic`.
2019-05-07 20:14:40 -07:00
Greg Bolsinga 87335d8dc5 Keep the atomics - does not affect memory work (#1498)
Revert "Ensure ASControlMode properties lock before accessing their ivars (#1476)"
This reverts commit ce1e1956f4.

Revert "Make sure all ASDisplayNode properties have backing ivars for consistency. (#1475)"
This reverts commit d6061f4390.
- Except the unused property `interfaceStateSuspended` is still removed (this is a memory saver).
2019-05-07 20:14:19 -07:00
Greg Bolsinga 7470052f55 Remove unused declaration, missed in #1460 (#1497) 2019-05-07 13:42:22 -07:00
Greg Bolsinga 4d1176be4d Shrink ASImageNode by .6% and ASNetworkImageNode by 2.2% (#1487)
* Shrink ASImageNode by .6% and ASNetworkImageNode by 2.2%

ASImageNode goes from 1384 to 1376. ASNetworkImageNode goes from 1496 to 1464.

These objects accumulate in the heap, so reducing their size will allow more to accumulate before memory warnings.

Group the `BOOL`s into a struct. Shrink the various stored `enum`s to fit the size of their contents. Move the ivars around so that the smaller `enum` are near eachother and the bitfield struct.

* add comments as requested in garrett's review.

* access ivar directly since already locked as suggested in review.
2019-05-07 11:17:59 -07:00
Greg Bolsinga 8b70b760db Shrink Pager and Scroll Node (#1496)
Running on iPhone SE Simulator:
ASPagerNode 1240 to 1232 bytes .7% reduction
ASScrollNode 1104 to 1096 bytes .7% reduction

- make ASScrollNode smaller by shrinking ASScrollDirection, which requires a change to ASRangeController
- shrink ASPagerNode by declaring the BOOL next to the struct
2019-05-07 09:58:11 -07:00
Greg Bolsinga 3374706e67 Shrink TextNode(2) (#1495)
Running in iPhone SE Simulator:
- ASTextNode: 1360 to 1352 bytes .6% reduction
- ASTextNode2: 1360 to 1304 bytes 4.3% redction

Shrink stored enum sizes. Group BOOLs near these smaller enums. Override -usingExperiment to return constant instead of never set, but allocated ivar.
2019-05-07 09:57:49 -07:00
Greg Bolsinga 2fdcee81cd Shrink Button Node (#1494)
Button: 1312 to 1288 bytes, running on iPhone SE simulator. 1.9% reduction.

Shrink the enums it stores, and place them next to each other (along with a BOOL) to reduce instance size.
2019-05-07 09:57:03 -07:00
Greg Bolsinga c571c8d1c4 Shrink ASDisplayNode from 1072 to 968 bytes, reduction of 10.74% (#1484)
* Shrink ASDisplayNode from 1088 to 976 bytes, reduction of 11.48%

These objects accumulate in the heap, so reducing their size will allow more to accumulate before memory warnings.

Group the `BOOL`s into a struct. Shrink the various stored `enum`s to fit the size of their contents. Move the ivars around so that the smaller `enum` are near eachother and the bitfield struct.

* Forgot to bit-field-ify placeholderEnable; new small size is 968, old size is 1072 (measured consistentlyl on iPhoneSE simulator). 10.74% reduction.
2019-05-07 09:56:33 -07:00
Greg Bolsinga b9e0fddc04 Shrink _ASPendingState from 824 to 808 bytes, reduction of ~2% (#1483)
* Shrink _ASPendingState from 824 to 808 bytes, reduction of ~2%

These objects accumulate in the heap, so reducing their size will allow more to accumulate before memory warnings.

Shrink ASPendingState BOOLs. Use unsigned int for these bitfields for clarity. Separate from `_flags` as that struct is compared to `0` for testing. The `_boolFlags` struct is just storing other `BOOL`s.

* rename struct fields as suggested in garret's review.
2019-05-07 09:56:11 -07:00
Greg Bolsinga c3e608b04e Shrink _ASCollectionPendingState from 144 to 128 bytes, a 12.5% reduction (#1485)
* Shrink _ASCollectionPendingState from 144 to 128 bytes, a 12.5% reduction

These objects accumulate in the heap, so reducing their size will allow more to accumulate before memory warnings.

Group the `BOOL`s into a struct. Shrink the various stored `enum`s to fit the size of their contents. Move the ivars around so that the smaller `enum` are near eachother and the bitfield struct.

* address review comments. move enums out. add comment. rename struct to _flags

* fix a missing rename
2019-05-07 09:50:36 -07:00
Huy Nguyen bf82b56253 Ship ASExperimentalFixRangeController (#1486) 2019-05-06 17:20:16 -07:00
Adlai Holler 64c43c0ded Add a new "global drawing" experiment to use UIGraphicsRenderer (#1469)
* Add a new "global drawing" experiment to use UIGraphicsRenderer everywhere, when available

* Fix logic

* Use preferredFormat
2019-05-02 20:42:23 -07:00
Greg Bolsinga ce1e1956f4 Ensure ASControlMode properties lock before accessing their ivars (#1476)
Enable `#pragma clang diagnostic error "-Wobjc-missing-property-synthesis"` for this file.
2019-05-01 12:40:48 -07:00
Greg Bolsinga d6061f4390 Make sure all ASDisplayNode properties have backing ivars for consistency. (#1475)
* Make sure all ASDisplayNodes have backing ivars for consistency.

Found this by enabling #pragma clang diagnostic error "-Wobjc-missing-property-synthesis" for ASDisplayNode. One property is unused, saving 8 bytes of heap space per instance on 64-bit builds. Implement setter/getters for these properties, and add appropriate locking. add the warning as error to the build for this file.
2019-04-30 15:56:03 -07:00
Adlai Holler 15fb7e0c1f Fix open context bug introduced in #1458 (#1468) 2019-04-25 15:38:40 -07:00
Michael Schneider 0cfafca9f6 Passthrough pagingEnabled for ASCollectionNode / ASTableNode (#1466)
* Passthrough pagingEnabled for ASCollectionNode and ASTableNode

* Add tvOS handling
2019-04-25 14:02:10 -07:00
Michael Zuccarino bb6c89e3ba Cover the other background dealloc surfaces (#1464) 2019-04-23 12:15:23 -07:00
Adlai Holler 4d524495b3 Remove ASEventLog (#1460)
* Remove ASEventLog. We'll focus on ASLog for the future, possibly making it triggerable on a per-node basis

* See ya!

* Hello semicolon

* Remove refs to gone tree methods

* Fix

* Remove irrelevant change, kick CI

* Clean up
2019-04-23 10:33:44 -07:00
Adlai Holler 5143941e49 Drop support for Xcode 8 and fix some compiler warnings (#1463) 2019-04-23 08:02:21 -07:00
Adlai Holler f653128d03 Remove iOS 8 support from logging code. (#1462) 2019-04-23 08:01:28 -07:00
Oskar Zhang e63e90a968 Make ASCollectionNode's pan gesture customizable (#1457)
* changes done

* complete set of uigesturedeleagte methods
2019-04-22 17:02:36 -07:00
Wu Zhong 5aef12d4fb Try to remove global lock when initialising TextKit components (#1455)
* Try to remove global lock when initialising TextKit components

* Adding experiment flag to dis/enable lock of textkit component

* Adding tests

* code clean

fix typo

Make remove lock optional

Keep locks

code clean
2019-04-22 11:29:34 -07:00
Huy Nguyen 3120c4e4ee Disable ASAssertLocked and ASAssertUnlocked (#1412) 2019-04-19 23:22:53 -07:00
Wu Zhong 5c185baae9 Remove lock of ASTextNodeRendererKey (#1454)
* Remove lock of ASTextNodeRendererKey

* Remove class check for isEqual

* Add const specifier to function parameter

* Fixes typo

* Fixes typo
2019-04-19 14:07:18 -07:00
Adlai Holler 38a67dd328 Shut down graphics contexts experiment (#1458)
* Shut down graphics contexts experiment

* Remove dead import

* Remove gone class
2019-04-18 18:36:39 -07:00
Harry Shamansky e4f4220b2b [#1451] Add support for UIAccessibilityCustomAction (#1452)
This PR adds support for UIAccessibilityCustomAction propagation through ASPendingState so that it can be picked up by VoiceOver.
2019-04-17 12:30:11 -07:00
Adlai Holler f48d778e3f Only create activities during debug (#1456) 2019-04-16 14:41:42 -07:00
Tim Norman 981482c564 Add didEnterHierarchy/didExitHierarchy to ASNodeController. (#1444) 2019-04-12 12:13:43 -07:00
Eric Scheers d55fd47b88 [ASTextNode] Maintain isAccessibilityElement setting on text nodes when updating text (#1326) 2019-04-09 08:14:36 -07:00
Michael Schneider b9c8b3233b Use AS::Mutex in ASCollectionElement (#1445) 2019-04-05 15:49:36 -07:00
Michael Schneider a66f0483c9 Simplify ASTraitCollection propagation in ASViewController (#1447) 2019-04-05 15:49:27 -07:00
Michael Schneider 838ab85a99 Use instance lock for ASPrimitiveTraitCollection (#1442)
* Use instance lock for ASPrimitiveTraitCollection

* Remove the atomic
2019-04-04 07:32:29 -07:00
Adlai Holler a4957bbbf2 Revert "Have image nodes draw into opaque contexts automatically if possible (#1432)" (#1443)
This reverts commit 28522ce977.
2019-04-04 07:28:32 -07:00
Adlai Holler bf466e83f2 Fix the stub for layerActionForKey: to let CA continue the search (#1441)
* Fix the stub for layerActionForKey: to let CA continue the search

* Kick CI
2019-04-03 17:46:26 -07:00
Max Wang d970dc3548 Fix scroll node in yoga (#1435)
* fix SIMULATE_WEB_RESPONSE not imported #449

* Fix to make rangeMode update in right time

* remove uncessary assert

* Fix collection cell editing bug for iOS 9 & 10

* Revert "Fix collection cell editing bug for iOS 9 & 10"

This reverts commit 06e18a1059.

* Fix child not fit to full scroll node's bounds when flex_grow = 1.0 is used on child
2019-04-02 08:11:25 -07:00
Greg Bolsinga 442317b8ab Wrap transaction operation retain cycle fix in an experiment (#1438)
* Wrap transaction operation retain cycle fix in an experiment

This is a follow on to #1429.

* fix typo in experiment name. fix copyright in tests file.
2019-04-01 16:11:52 -07:00
Adlai Holler 19e1a34a70 Add a verbose log for locking operations. Has no effect in production (#1436)
* Add a verbose log for locking operations. Has no effect in production

* Need check
2019-04-01 11:20:38 -07:00
ricky 453465564d [ASDisplayNode] Stop infinite layout in _u_measureNodeWithBoundsIfNecessary (#1434)
We came across an infinite layout loop in `_u_measureNodeWithBoundsIfNecessary`. After requesting a layout from above, the sizes between pending and caluclated layout still do not match. We continue to prefer to use the pending layout and ask for another layout loop from above. We can’t seem to break out of this loop. The solution (thanks to Huy for the guidance) was to nil out the pending layout we get from requesting the layout from above.

I was only able to reproduce this when working with a node in a `UINavigationBarItem’s` `titleView`. I think that UIKit must be doing something sneaky with setting the frame on the view. While I was not able to create a unit test to catch this issue (I tried for a long time, and can post what I’ve come up with to see if anyone has any suggestions), I was able to create a pretty simple example project that shows the behavior:
https://github.com/rcancro/TextureLayoutLoopExample
2019-04-01 08:53:47 -07:00
Adlai Holler 28522ce977 Have image nodes draw into opaque contexts automatically if possible (#1432)
* Have image nodes draw into opaque contexts if the image is opaque and it fills the context

* Call backingSize once
2019-03-29 11:16:35 -07:00
Ballad 8231599d43 [ASImageNode]fix incorrect backing size calculation (#1189)
* fix backing size for image node which content mode is scaleAspectFit

* chore: update comments and naming

* add change log

* Update CHANGELOG.md

* Update CHANGELOG.md

Co-Authored-By: junjielu <348649634@qq.com>

* add unit test for backing size calculation

* correct license
2019-03-29 10:45:55 -07:00
Adlai Holler fe1cb1c79d Add support for clipping only specific corners, add unit tests (#1415)
* Add support for clipping only specific corners, add unit tests

* Remove some cleanup to make the diff smaller

* Fix
2019-03-28 18:42:33 -07:00
Max Wang 039b6f03dd Fix dealloc on bg (#1410)
* fix SIMULATE_WEB_RESPONSE not imported #449

* Fix to make rangeMode update in right time

* remove uncessary assert

* Fix collection cell editing bug for iOS 9 & 10

* Revert "Fix collection cell editing bug for iOS 9 & 10"

This reverts commit 06e18a1059.

* Fix dealloc long gesture in background
2019-03-28 18:42:16 -07:00
Jacob Farkas 69f42dbb1d Replace +load initializers with __attribute__((constructor)) functions (#1425)
* Replace +load initializers with __attribute__((constructor)) functions

* Updating the documentation for textureDidInitialize, per @nguyenhuy
2019-03-28 18:41:42 -07:00
Greg Bolsinga 5f8161ece7 Fix retain cycle with transaction operations (#1429)
Add unit tests that help find cycles. `-testWeakWithSingleOperation` fails without the code fix applied.
2019-03-28 18:37:06 -07:00
Michael Zuccarino dfd44e8b9e [Experiment] Dont forget about these collection view background deallocs (#1424)
* Dont forget about these collection view background deallocs

* Also Table view for completeness
2019-03-27 11:23:27 -07:00
Michael Zuccarino 27cc0f2717 Experiment with disabling ASViewController background dealloc (#1420) 2019-03-25 14:11:04 -07:00
Huy Nguyen dbe1ceb77c Follow up on the ASRangeController fix in #1418 (#1419)
The changes in #1418 is a bit too aggressive when it comes to nodes that are in display range. It forces those nodes to not preload.

Also update the changes to avoid diluting the experiment data by triggering too broadly (i.e avoid triggering when the old and new implementations yield the same result leading to no behavior change).
2019-03-22 12:41:49 -07:00