Commit Graph

6 Commits

Author SHA1 Message Date
Joshua Gross 1cab7ad1d6 Core: Fix props parsing when accessing prop more than once in Props struct initialization
Summary:
See previous diff implementing failing unit test in RawPropsTest.cpp.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18664014

fbshipit-source-id: ef827bce8c676666b2ce4d5db4abbb0ab11cc454
2019-11-27 12:55:46 -08:00
Joshua Gross fb9cddcab0 Core: Fix infinite loop in prop parsing
Summary:
See previous diff where I added RawPropsTest.cpp to unit-test this functionality. Before this, if you looked up a prop name that does not exist, the prop parser would enter an infinite loop.

I also took this opportunity to comment the block a little bit as it's not super intuitive at first glance.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18662135

fbshipit-source-id: 319a3b80d1c606db18b2added9f2aa99d4d03407
2019-11-27 12:55:46 -08:00
Andres Suarez 3b31e69e28 Tidy up license headers [2/n]
Summary: Changelog: [General] [Fixed] - License header cleanup

Reviewed By: yungsters

Differential Revision: D17952694

fbshipit-source-id: 17c87de7ebb271fa2ac8d00af72a4d1addef8bd0
2019-10-16 10:06:34 -07:00
Valentin Shergin df229590b2 Fabric: Adding missing noexcept operator to functions in raw props parsing infra
Summary:
This part of the codebase is very perf sensitive and designed to work without exceptions enabled.
Most of the method was `noexcept` all the time, but some of those missing that by mistake.

Reviewed By: sammy-SC

Differential Revision: D17629426

fbshipit-source-id: b311e4b7eff8e2b7cf29518288480d3a812dda44
2019-09-29 20:04:15 -07:00
Valentin Shergin 902541e874 Fabric: Fixing a concurrency issue in RawProp parsing infra
Summary:
Previously, we stored `keyIndex_` in a Parser object which is incorrect because it makes the parsing process thread-unsafe (the Parser is shared between parsing processes).

That worked previously most of the time because we never parsed props concurrently but we actually do this in the native animation library.

Reviewed By: yungsters

Differential Revision: D16064557

fbshipit-source-id: 211f4301d0746e0f5126a1dcdd59f1ae9a420aa9
2019-06-28 22:53:45 -07:00
Valentin Shergin 874f656435 Fabric: Rethinking of prop parsing infra
Summary:
This diff reimplements the prop parsing infrastructure in a part where it interacts with RawProps value.

Local synthetic tests show that the new way is 3x faster but the actual production result is quite unpredictable. MobileLab tests show some improvements about 10-20 ms on iPhone 6.

In short, the new way is faster because it inverts the lookup order and heavily relies on actual data types (and their properties) that we use. The old approach required about 130 hash-map lookups (where the key is `std::string`) to parse a single *Props object.
The new approach prepares concrete-props-specific tables with indexes of coming values ahead of time,  iterates over raw data and puts it into those tables, and then performs a lookup in a very efficient manner.

Reviewed By: JoshuaGross

Differential Revision: D15752968

fbshipit-source-id: 847106e652eb7fc7ef7b99884a6f819ea3b9fd06
2019-06-12 21:35:21 -07:00