Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve bridge call performance. #328

Merged
merged 29 commits into from
May 21, 2021
Merged

feat: improve bridge call performance. #328

merged 29 commits into from
May 21, 2021

Conversation

andycall
Copy link
Member

@andycall andycall commented May 15, 2021

  1. 在 android 平台下移除 promise polyfill,减少初始化耗时
  2. 通过缓存已经转换的字符串来减少初始化阶段字符串转换的耗时
  3. 优化 propertyMap 读取阶段的耗时

经测试,下面的这种写法会导致每次调用都复制一遍整个 map

 auto propertyMap = getWindowPropertyMap();
 auto prototypePropertyMap = getWindowPrototypePropertyMap();

采用下面的写法,可以有效避免没有必要的 copy

auto &propertyMap = getWindowPropertyMap();
auto &prototypePropertyMap = getWindowPrototypePropertyMap();

某个页面的性能测试数据:

Before

   + js_bundle_eval_cost 1411.88ms

After

 + js_bundle_eval_cost 1058.20ms

Copy link
Member

@wssgcg1213 wssgcg1213 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

学习了,bridge 的提升有没有数据指标

bridge/bindings/jsc/KOM/timer.cc Outdated Show resolved Hide resolved
@wssgcg1213
Copy link
Member

然后 ci 貌似又出问题了

@andycall andycall force-pushed the feat/op_bridge branch 2 times, most recently from 9419ebd to a18c721 Compare May 17, 2021 03:38
@andycall andycall dismissed a stale review via 8e55258 May 19, 2021 14:05
@yuanyan yuanyan dismissed a stale review via 56f0e46 May 20, 2021 08:07
@andycall andycall dismissed a stale review via c121f7b May 21, 2021 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants