Skip to content

perf(runtime): Lazy evaluation of properties#1100

Merged
mbektchiev merged 4 commits intomasterfrom
bektchiev/lazy-props
Mar 21, 2019
Merged

perf(runtime): Lazy evaluation of properties#1100
mbektchiev merged 4 commits intomasterfrom
bektchiev/lazy-props

Conversation

@mbektchiev
Copy link
Copy Markdown
Contributor

@mbektchiev mbektchiev commented Mar 18, 2019

  • Patch JSC to allow for dynamic property definition during assignment
    (write access)

  • Make ObjCPrototype::materializeProperties a no op

  • Make ObjCPrototype::getOwnPropertySlot check metadata for properties,
    before searching for a method

  • perf(metadata): Do not scan for property overloads
    Properties cannot have "JS overloads" in base classes as methods do
    and there's no need to traverse the hierarchy. JS overloads are methods
    with different selectors and number of arguments which have the same jsName.

  • fix(metadata): Remove duplicate properties coming from categories
    UIKit has some examples of such cases that need deduplication:

    • UIApplication(UIApplicationDeprecated) category defines a couple of
      properties which are duplicated in the UIApplication class. In this case,
      all of them are deprecated and only the class' members should be left in
      the metadata.
    • UIGestureRecognizer (UIGestureRecognizerProtected) category redefines
      the state property as readwrite for use by subclasses of UIGestureRecognizer.
      In this case, it's better to take the category's property as it is more generic and hasn't
      got any deprecation or obsoletion attributes set. This way users will be able to use it
      in a JS implemented subclass of UIGestureRecognizer.

PR Checklist

BREAKING CHANGES

Properties UIApplication.statusBarStyle and UIApplication.statusBarHidden are now read-only. Any code assigning to them should be removed. See #1104

@mbektchiev mbektchiev added this to the 5.3.0 milestone Mar 18, 2019
@mbektchiev mbektchiev self-assigned this Mar 18, 2019
@cla-bot cla-bot Bot added the cla: yes label Mar 18, 2019
@mbektchiev
Copy link
Copy Markdown
Contributor Author

test --performance

@Natalia-Hristova
Copy link
Copy Markdown

test --performance-only

@mbektchiev mbektchiev marked this pull request as ready for review March 19, 2019 12:38
@mbektchiev mbektchiev force-pushed the bektchiev/lazy-props branch from e03923d to 87bd509 Compare March 19, 2019 14:35
@mbektchiev
Copy link
Copy Markdown
Contributor Author

test --performance

1 similar comment
@mbektchiev
Copy link
Copy Markdown
Contributor Author

test --performance

Comment thread src/NativeScript/ObjC/ObjCPrototype.mm Outdated
@mbektchiev mbektchiev force-pushed the bektchiev/lazy-props branch from 87bd509 to e50577e Compare March 20, 2019 14:21
* Patch JSC to allow for dynamic property definition during assignment
(write access)
* Make `ObjCPrototype::materializeProperties` a no op
* Make `ObjCPrototype::getOwnPropertySlot` check metadata for properties,
before searching for a method
* Merge metadata of duplicated properties coming from a category
* Add tests
Properties cannot have "JS overloads" in base classes as methods do
and there's no need to traverse the hierarchy. JS overloads are methods
with different selectors and number of arguments which have the same jsName
Create a reusable StopwatchLogger class and replace the
commented profiling code in `ObjCPrototype::getOwnPropertySlot`
to use it.
There's an issue with the linker paths to `NativeScript.framework`.
Add `NativeScript` target as a target dependency and manually add the path
to the binary
@mbektchiev mbektchiev force-pushed the bektchiev/lazy-props branch from b286214 to d2f15c7 Compare March 20, 2019 16:21
@mbektchiev
Copy link
Copy Markdown
Contributor Author

test --performance

@vtrifonov
Copy link
Copy Markdown
Contributor

test

@mbektchiev mbektchiev merged commit 90967df into master Mar 21, 2019
@mbektchiev mbektchiev deleted the bektchiev/lazy-props branch March 21, 2019 03:49
mbektchiev added a commit to NativeScript/sample-Groceries that referenced this pull request Mar 21, 2019
The latest iOS Runtime exposes `UIApplication`'s `statusBarStyle`
property as readonly because write access to it has been deprecated
since iOS 9.0. See https://developer.apple.com/documentation/uikit/uiapplication/1622988-statusbarstyle?language=objc

The new behavior in iOS is introduced with NativeScript/ios-jsc#1100
mbektchiev added a commit to NativeScript/sample-Groceries that referenced this pull request Mar 21, 2019
The latest iOS Runtime exposes `UIApplication`'s `statusBarStyle`
property as readonly because write access to it has been deprecated
since iOS 9.0. See https://developer.apple.com/documentation/uikit/uiapplication/1622988-statusbarstyle?language=objc

The new behavior in iOS is introduced with NativeScript/ios-jsc#1100
mbektchiev added a commit to NativeScript/nativescript-marketplace-demo that referenced this pull request Mar 21, 2019
The latest iOS Runtime exposes UIApplication's statusBarStyle
property as read-only because write access to it has been deprecated
since iOS 9.0. The status bar's style is automatically adjusted and
this code should not be needed.

See https://developer.apple.com/documentation/uikit/uiapplication/1622988-statusbarstyle?language=objc

The new behavior in iOS is introduced with NativeScript/ios-jsc#1100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants