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

[perf] upgrade realm and improve schemas/queries #8336

Merged
merged 1 commit into from
Jun 4, 2019

Conversation

yenda
Copy link
Contributor

@yenda yenda commented Jun 2, 2019

  • upgrade to realm 2.28 to benefit from perf improvements
  • remove user-statuses and replace by seen and outgoing-status fields
    to get rid of a lot of bloat queries and computations and in-queries which don't
    work in this version of realm
  • remove unused seen message, bottom-infos

Tests

Tested on Android

Tested:

  • send and receive messages from public and private chats

To test:

  • start from nightlies with some chats that have unread messages and unsent messages
  • install this version and check that the migrations worked

MV5BZjkyYThhNWMtYWRiZi00ZjQyLThiYzYtZjkwYmVkYTRlYTIwXkEyXkFqcGdeQXVyNTk1ODg5ODA@ V1

status: wip

@yenda yenda requested review from antdanchenko, churik, vkjr and a team as code owners June 2, 2019 02:29
@yenda yenda self-assigned this Jun 2, 2019
@status-github-bot
Copy link

status-github-bot bot commented Jun 2, 2019

Pull Request Checklist

  • Have you updated the documentation, if impacted (e.g. docs.status.im)?

@status-im-auto
Copy link
Member

status-im-auto commented Jun 2, 2019

Jenkins Builds

Click to see older builds (24)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ d3294d6 #1 2019-06-02 02:43:09 ~13 min ios 📦 ipa
✔️ d3294d6 #1 2019-06-02 02:44:37 ~14 min linux 📦 App
✔️ d3294d6 #1 2019-06-02 02:45:32 ~15 min macos 📦 dmg
✔️ d3294d6 #1 2019-06-02 02:45:44 ~15 min windows 📦 exe
✔️ d3294d6 #1 2019-06-02 02:47:40 ~17 min android-e2e 📦 apk
✔️ d3294d6 #1 2019-06-02 02:48:37 ~18 min android 📦 apk
✔️ 458543a #2 2019-06-03 16:45:11 ~13 min linux 📦 App
✔️ 458543a #2 2019-06-03 16:45:57 ~14 min ios 📦 ipa
✔️ 458543a #2 2019-06-03 16:46:25 ~14 min windows 📦 exe
✔️ 458543a #2 2019-06-03 16:49:17 ~17 min macos 📦 dmg
✔️ 458543a #2 2019-06-03 16:50:44 ~18 min android 📦 apk
458543a #2 2019-06-03 16:54:58 ~23 min android-e2e 📄 log
4695338 #3 2019-06-04 10:55:24 ~3 min ios 📄 log
4695338 #3 2019-06-04 10:55:31 ~3 min linux 📄 log
4695338 #3 2019-06-04 10:55:41 ~3 min windows 📄 log
4695338 #3 2019-06-04 10:56:00 ~3 min macos 📄 log
4695338 #3 2019-06-04 11:01:57 ~9 min android 📄 log
4695338 #3 2019-06-04 11:02:01 ~9 min android-e2e 📄 log
✔️ 4974141 #4 2019-06-04 11:18:41 ~15 min ios 📦 ipa
✔️ 4974141 #4 2019-06-04 11:19:28 ~15 min windows 📦 exe
✔️ 4974141 #4 2019-06-04 11:19:28 ~15 min linux 📦 App
✔️ 4974141 #4 2019-06-04 11:20:04 ~16 min macos 📦 dmg
✔️ 4974141 #4 2019-06-04 11:23:39 ~20 min android 📦 apk
✔️ 4974141 #4 2019-06-04 11:24:27 ~20 min android-e2e 📦 apk
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 5035895 #5 2019-06-04 11:55:06 ~13 min ios 📦 ipa
✔️ 5035895 #5 2019-06-04 11:55:39 ~13 min linux 📦 App
✔️ 5035895 #5 2019-06-04 11:56:14 ~14 min windows 📦 exe
✔️ 5035895 #5 2019-06-04 12:00:37 ~18 min macos 📦 dmg
✔️ 5035895 #5 2019-06-04 12:01:33 ~19 min android 📦 apk
✔️ 5035895 #5 2019-06-04 12:01:44 ~20 min android-e2e 📦 apk
✔️ fda6c36 #7 2019-06-04 21:49:36 ~13 min ios 📦 ipa
✔️ fda6c36 #7 2019-06-04 21:50:38 ~14 min android 📦 apk
✔️ fda6c36 #7 2019-06-04 21:52:04 ~16 min macos 📦 dmg
✔️ fda6c36 #7 2019-06-04 21:53:21 ~17 min android-e2e 📦 apk
✔️ fda6c36 #7 2019-06-04 21:54:09 ~18 min windows 📦 exe
✔️ fda6c36 #7 2019-06-04 21:54:49 ~18 min linux 📦 App

@jakubgs
Copy link
Member

jakubgs commented Jun 3, 2019

I wonder if this might help with #8326 .

@yenda yenda force-pushed the perf/upgrade-realm-and-schemas branch from d3294d6 to 458543a Compare June 3, 2019 16:31
Copy link
Member

@jakubgs jakubgs left a comment

Choose a reason for hiding this comment

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

I'm approving only the yarn.lock changed, the Clojure stuff is black magic.

(assoc :appearing? false)
(cond-> message
current-chat?
(assoc :seen true)
Copy link
Member

Choose a reason for hiding this comment

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

could you elaborate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

appearing is useless, not needed.
If the message is received in the current chat it is considered seen. It was already the case before just not done here

@yenda yenda force-pushed the perf/upgrade-realm-and-schemas branch from 4695338 to 4974141 Compare June 4, 2019 11:03
@yenda yenda force-pushed the perf/upgrade-realm-and-schemas branch from 4974141 to 5035895 Compare June 4, 2019 11:41
@status-im status-im deleted a comment from statustestbot Jun 4, 2019
@status-im status-im deleted a comment from dependency-lockfile-snitch bot Jun 4, 2019
@status-im status-im deleted a comment from statustestbot Jun 4, 2019
@status-im status-im deleted a comment from dependency-lockfile-snitch bot Jun 4, 2019
@status-im status-im deleted a comment from dependency-lockfile-snitch bot Jun 4, 2019
@status-im status-im deleted a comment from dependency-lockfile-snitch bot Jun 4, 2019
@status-im status-im deleted a comment from dependency-lockfile-snitch bot Jun 4, 2019
@statustestbot
Copy link

98% of end-end tests have passed

Total executed tests: 49
Failed tests: 1
Passed tests: 48

Failed tests (1)

Click to expand
1. test_send_tokens_in_1_1_chat

Device 2: Looking for a message by text: '0.004131042'
Device 2: Wait for ChatElementByText

Message with the sent amount is not shown for the recipient, also Unexpected Alert is shown: 'Array size is not a small enough positive integer.'

Device sessions

Passed tests (48)

Click to expand
1. test_block_user_from_public_chat
Device sessions

2. test_filters_from_daap
Device sessions

3. test_copy_and_paste_messages
Device sessions

4. test_send_transaction_from_daap
Device sessions

5. test_request_and_receive_tokens_in_1_1_chat
Device sessions

6. test_deploy_contract_from_daap
Device sessions

7. test_open_transaction_on_etherscan
Device sessions

8. test_public_chat_messaging
Device sessions

9. test_long_press_to_delete_1_1_chat
Device sessions

10. test_password_in_logcat_sign_in
Device sessions

11. test_text_message_1_1_chat
Device sessions

12. test_add_to_contacts
Device sessions

13. test_sign_typed_message (TestRail link is not found)
Device sessions

14. test_unread_messages_counter_1_1_chat
Device sessions

15. test_logcat_send_transaction_from_daap
Device sessions

16. test_send_message_in_group_chat
Device sessions

17. test_logcat_send_transaction_from_wallet
Device sessions

18. test_send_token_with_7_decimals
Device sessions

19. test_modify_transaction_fee_values
Device sessions

20. test_send_eth_from_wallet_to_address
Device sessions

21. test_manage_assets
Device sessions

22. test_logcat_send_transaction_in_1_1_chat
Device sessions

23. test_request_and_receive_eth_in_1_1_chat
Device sessions

24. test_long_press_to_delete_public_chat
Device sessions

25. test_send_emoji
Device sessions

26. test_search_chat_on_home
Device sessions

27. test_logcat_recovering_account
Device sessions

28. test_messaging_in_different_networks
Device sessions

29. test_network_mismatch_for_send_request_commands
Device sessions

30. test_logcat_sign_message_from_daap
Device sessions

31. test_switch_users_and_add_new_account
Device sessions

32. test_send_stt_from_wallet
Device sessions

33. test_send_eth_in_1_1_chat
Device sessions

34. test_login_with_new_account
Device sessions

35. test_send_eth_from_wallet_to_contact
Device sessions

36. test_add_contact_from_public_chat
Device sessions

37. test_send_two_transactions_one_after_another_in_dapp
Device sessions

38. test_password_in_logcat_creating_account
Device sessions

39. test_backup_recovery_phrase
Device sessions

40. test_offline_status
Device sessions

41. test_open_google_com_via_open_dapp
Device sessions

42. test_unread_messages_counter_public_chat
Device sessions

43. test_sign_message_from_daap
Device sessions

44. test_user_can_remove_profile_picture
Device sessions

45. test_share_contact_code_and_wallet_address
Device sessions

46. test_request_eth_in_wallet
Device sessions

47. test_refresh_button_browsing_app_webview
Device sessions

48. test_backup_recovery_phrase_warning_from_wallet
Device sessions

@asemiankevich asemiankevich self-assigned this Jun 4, 2019
@statustestbot
Copy link

100% of end-end tests have passed

Total executed tests: 1
Failed tests: 0
Passed tests: 1

Passed tests (1)

Click to expand
1. test_send_tokens_in_1_1_chat
Device sessions

@yenda
Copy link
Contributor Author

yenda commented Jun 4, 2019

@asemiankevich this is a bug I've seen a few times already in other PR, I have never been able to reproduce in the emulator so I don't really now where it is coming from

@dependency-lockfile-snitch
Copy link

mobile_files/yarn.lock changed. Pinging @jakubgs, @mandrigin, and @corpetty

1 similar comment
@dependency-lockfile-snitch
Copy link

mobile_files/yarn.lock changed. Pinging @jakubgs, @mandrigin, and @corpetty

@asemiankevich
Copy link
Contributor

@asemiankevich this is a bug I've seen a few times already in other PR, I have never been able to reproduce in the emulator so I don't really now where it is coming from

@yenda i've logged it separately, no worries! Apart from this current PR looks good to me, upgrade looks okay-ish.

@dependency-lockfile-snitch
Copy link

mobile_files/yarn.lock changed. Pinging @jakubgs, @mandrigin, and @corpetty

@yenda yenda force-pushed the perf/upgrade-realm-and-schemas branch from af0e10d to fda6c36 Compare June 4, 2019 21:35
@dependency-lockfile-snitch
Copy link

mobile_files/yarn.lock changed. Pinging @jakubgs, @mandrigin, and @corpetty

- upgrade to realm 2.28 to benefit from perf improvements
- remove user-statuses and replace by seen and outgoing-status fields
to get rid of a lot of bloat queries and computations
- remove unused seen message, bottom-infos
- remove unused fields in transport schema
- use objectForPrimaryKey whenever possible instead of get by field

Signed-off-by: yenda <eric@status.im>
@yenda yenda force-pushed the perf/upgrade-realm-and-schemas branch from fda6c36 to 1ae42ea Compare June 4, 2019 21:36
@dependency-lockfile-snitch
Copy link

mobile_files/yarn.lock changed. Pinging @jakubgs, @mandrigin, and @corpetty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants