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

[SPIKE] Status-go Database performance investigation #10558

Closed
10 tasks done
jrainville opened this issue May 4, 2023 · 7 comments
Closed
10 tasks done

[SPIKE] Status-go Database performance investigation #10558

jrainville opened this issue May 4, 2023 · 7 comments
Assignees
Milestone

Comments

@jrainville
Copy link
Member Author

cc @iurimatias @John-44 @cammellos if you want to follow the progress

@caybro
Copy link
Member

caybro commented May 4, 2023

Coincidentally, I was also looking into this today and so I fired the excellent hotspot tool and here's a couple of findings from running the app for about 2-3 minutes (usual "messenger" session):

36% of all CPU cycles is spent inside sha1_compress:
Snímek obrazovky z 2023-05-04 13-47-38

The same, using top-down breakdown:
Snímek obrazovky z 2023-05-04 13-49-22

Going into even more detail, 27% of all CPU cycles is spent on this single line, still inside sha1_compress:
(https://github.com/mutecomm/go-sqlcipher/blob/25f68adb9fb3bc95229bee7e3498a6ca2f3e752d/sha1.c#L61)
Snímek obrazovky z 2023-05-04 13-57-40

@caybro
Copy link
Member

caybro commented May 4, 2023

(I can upload the raw perf.data file, if anyone's interested in inspecting and visualizing this on Linux)

@caybro
Copy link
Member

caybro commented May 4, 2023

I hope it gives at least some insight where (and what) to start looking in first :) The sha1 looks like an ideal candidate for some vectorization (OpenSSL uses MMX/AVX512 or even SHA extensions found in recent Intel/AMD CPUs), I assume that implementation must be orders of magnitudes faster

@John-44
Copy link

John-44 commented May 4, 2023

I hope it gives at least some insight where (and what) to start looking in first :) The sha1 looks like an ideal candidate for some vectorization (OpenSSL uses MMX/AVX512 or even SHA extensions found in recent Intel/AMD CPUs), I assume that implementation must be orders of magnitudes faster

Do you want to talk a look at the specific issue you've identified here (optimise sha1_compress)? ;-)

I think (but somebody correct me if I'm wrong) that looking into optimisation of sha1_compress is complementary with everything else discussed today. If you do want to take a stab at this, I would recommend creating a seperate issue for just this task.

@caybro
Copy link
Member

caybro commented May 4, 2023

I hope it gives at least some insight where (and what) to start looking in first :) The sha1 looks like an ideal candidate for some vectorization (OpenSSL uses MMX/AVX512 or even SHA extensions found in recent Intel/AMD CPUs), I assume that implementation must be orders of magnitudes faster

Do you want to talk a look at the specific issue you've identified here (optimise sha1_compress)? ;-)

I think (but somebody correct me if I'm wrong) that looking into optimisation of sha1_compress is complementary with everything else discussed today. If you do want to take a stab at this, I would recommend creating a seperate issue for just this task.

Deal ;)

@alexjba
Copy link
Contributor

alexjba commented May 8, 2023

@osmaczko osmaczko moved this from Iteration Backlog to In Progress in Status Desktop/Mobile Board May 9, 2023
osmaczko added a commit to status-im/status-go that referenced this issue May 18, 2023
osmaczko added a commit to status-im/status-go that referenced this issue May 22, 2023
osmaczko added a commit to status-im/status-go that referenced this issue May 22, 2023
osmaczko added a commit to status-im/status-go that referenced this issue May 22, 2023
osmaczko added a commit to status-im/status-go that referenced this issue May 22, 2023
osmaczko added a commit to status-im/status-go that referenced this issue May 23, 2023
osmaczko added a commit to status-im/status-go that referenced this issue May 23, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Status Desktop/Mobile Board Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

6 participants