status-im / swarms

Swarm Home. New, completed and in-progress features for Status
92 stars 31 forks source link

Energy Efficient Status #83

Closed mandrigin closed 6 years ago

mandrigin commented 6 years ago

Preamble

Idea: 83
Title: Energy Efficient Status
Status: In Progress
Created: 2018-02-19

Summary

A specific issue about the energy efficiency of different parts of Status (status-go, status-react, desktop (when running on a laptop battery).

Swarm Participants

Product Overview

Energy consumption is a crucial part of the mobile experience, and even though it is related to performance, it is worth having a separate. The end goal is:

Goals

  1. Create a BoK for Energy efficiency testing: https://github.com/orgs/status-im/projects/18 a. test apps are created for both Android and iOS b. test cases are written and tools are created to measure the energy efficiency of both Status client (status-react+status-go) and tests apps (status-go exclusively). c. tests are run on a regular basis d. (stretch goal) tests are automated for both platforms

  2. Fix obvious issues with energy consumption https://github.com/orgs/status-im/projects/17

Exit criteria

Success Metrics

KR: (1) foreground energy consumption is < 120% of the apps in a similar class (messengers) (2) background energy consumption is < 120% of the apps in a similar class (messengers)

MVP(s)

MVP1 (docs & process): Create and integrate energy efficiency testing as a part of the release process (date: Mar, 30) MVP2 (development): Create a low-power background mode for status-go (date: Mar, 30)

Supporting Role Communication

Useful Links

https://github.com/dgryski/go-perfbook

Copyright

Copyright and related rights waived via CC0.

mandrigin commented 6 years ago

Since I've already started on https://github.com/status-im/status-go/issues/633, I'll put it to "in-progress"

mandrigin commented 6 years ago

That is exactly the pattern I see in our code: https://developer.apple.com/library/content/documentation/Performance/Conceptual/EnergyGuide-iOS/EnergyandNetworking.html

Let me see what we can do with it...

mandrigin commented 6 years ago

One more observation is that discv5 is CPU intensive for some reason.

dshulyak commented 6 years ago

@mandrigin good observation regarding discv5, we are not using v5 and discovery in general. But it is enabled by default in p2p.Config

mandrigin commented 6 years ago

@dshulyak then I guess we can have a quick fix disabling discv5 and it should quickly improve the battery life :)

mandrigin commented 6 years ago

Because of the tradeoff between real-time communications and efficient energy usage, we can't really optimize much when the app is in the foreground. What we can do, is to optimize the background usage, so on Android, the node doesn't consume that much energy when being in background.

mandrigin commented 6 years ago

Next steps for what's relatively easy to fix.

1. Put the node into some low-power mode when the app is in background (https://github.com/orgs/status-im/projects/17)

2. Make Energy Testing Body of Knowledge (https://github.com/orgs/status-im/projects/18)

lukaszfryc commented 6 years ago

I can contribute ~10h / week

oskarth commented 6 years ago

Closing this issue as part of spring cleaning. If this idea is still relevant, please submit a PR per https://github.com/status-im/ideas/#contributing. If you feel closing this issue is a mistake, feel free to re-open.