Skip to content

Commit

Permalink
new blog added
Browse files Browse the repository at this point in the history
  • Loading branch information
guofoo committed Nov 18, 2023
1 parent 9751906 commit b069fe2
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 4 deletions.
16 changes: 12 additions & 4 deletions content/blog/2023-11-13-performance-benchmarking.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
+++
title = "Performance Benchmarking"
description = ""
description = "Scrolling Tests with WeChat & TaBao Apps"
[extra]
author = "Edward Tan"
+++

The last time we did a performance benchmark test, it was a few months ago. At that time we used only one simple application, an image manipulation program. During the GOSIM Workshop in September, I had mentioned that we would be doing more performance benchmarking tests and we have done just that.

This time we used Makepad to write a sample WeChat application and a sample TaoBao application. The main test criteria is to stress the "scrolling" feature of the apps. We also had access to two sample applications of the same written in Android native.
This time we used Makepad to write a sample WeChat application and a sample TaoBao application. The main test criteria is to stress the "scrolling" feature of the apps. We also had access to two sample applications of the same written in Android "native".

## Test Methodology

Scrolling is one of the most important and common operations for mobile applications. For WeChat, a messaging application, and TaoBao, an e-commerce application, a smooth scrolling experience is often one of the key factors in user satisfaction with the application.

We benchmarked similar performance metrics as last time using Google Perfetto tool. These include:
We benchmarked similar performance metrics as last time using Google [Perfetto](https://ui.perfetto.dev) tool. These include:
* CPU Cycles
* CPU Frequency (Average & Max)
* CPU Memory (Average & Max)
* GPU Memory (Average & Max)

To test, we use the applications' main message or product list page. We exercise the scrolling by quickly swiping up and down on this scrollable page. We first quickly swipe for 6 to 10 times up (to make the list go down) and then 6 to 10 times down and repeat, until we reach the 10 seconds sample time.

*(Note that in real applications the scrolling list might have network dependencies such as loading of images, etc. But for the sample applications, the images are cached locally to the mobile app so there’s no network variance.)*
*(Note that in real applications the scrolling list might have network dependencies such as loading of images, etc. But for the sample applications, the images are cached locally to the mobile app so there’s no network latency or variance.)*

In order to have some more data points, we also benchmarked the official TaoBao app from the Google Play Store.

Expand Down Expand Up @@ -58,3 +58,11 @@ Being a fully functioning application, the official TaoBao app had a much higher
Also, there seems to be multiple processes related to the TaoBao application. We only counted the main TaoBao process. If we were to add the data from the TaoBao GPU process, then it will increase the amount of GPU memory usage by about 70 MB.

Overall, the results are consistent to what we found in our early benchmarking test. As Makepad framework continues to improve and evolve, the numbers will undoubtably change. We will periodically run more of these performance benchmarking and post our updates.

## References

Makepad WeChat sample:
[`https://github.com/project-robius/makepad_wechat`](https://github.com/project-robius/makepad_wechat)

Makepad TaoBao sample:
[`https://github.com/project-robius/makepad_taobao`](https://github.com/project-robius/makepad_taobao)
60 changes: 60 additions & 0 deletions content/blog/2023-11-17-performance-benchmarking-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
+++
title = "Performance Benchmarking - Part 2"
description = "Scrolling Tests with WeChat & TaBao Apps Updated"
[extra]
author = "Edward Tan"
+++

Several days ago we did a [performance benchmark](/blog/performance-benchmarking) test between sample apps written in Android "native" vs. Makepad. Afterwards, we were given access to another version of the sample TaoBao app with more functionality, including more animation/video content in the scroll list, and the ability to turn toggle some of the special effects.

So we did the same scrolling tests with this new version, both with the special features turned on, as well as with all features turned OFF, in order to compare the differences.

## Updated Results

![](/blog/scrolling-test-table-2.png)

As can be seen from the results, they seem similar and consistent with our previous results from the image manipulation benchmarks.

### CPU Processing

![](/blog/cpu-cycles-2.png)

On the CPU cycle, the sample Makepad WeChat app shows very little cycles used, having less than half of the Android "native" sample apps.

The Native TaoBao apps were similar to the Official TaoBao in that they use a lot more CPU cycles. This also results in higher CPU frequency values.

When special functionality are turned OFF, the Native TaoBao used ~40% less cycles. While the full-effect TaoBao used slightly more than the Official TaoBao app.

![](/blog/cpu-frequency-2.png)

This comment has been minimized.

Copy link
@univerz

univerz Nov 23, 2023

it might be interesting to look at the avg gpu frequency, as from my unscientific measurement developer options > show refresh rate stays at 120hz compared to dropping to 10 when idle (firefox, twitter).


The CPU frequencies also reflect that Makepad uses much less than the Android native counterparts.

Not much difference were noticed with the new Native TaoBao versions for GPU memory usage.

### Memory Usage

The CPU memory usage is more similar among the Android native and Makepad sample applications, with Makepad apps using slightly less CPU memory. This is consistent with less usage of the CPU cycles as well.

As expected, the new Native TaoBao performed noticeably better when its special effects were turned off.

![](/blog/cpu-memory-2.png)

The GPU memory shows that Makepad apps use more memory than the Android native apps. This is currently the only area where Makepad is not as efficient. However, the Makepad team is currently working on an improvement that will decrease this usage in the near future.

Not much difference were noticed with the new Native TaoBao versions for GPU memory usage.

![](/blog/gpu-memory-2.png)

## Conclusion

Being a more fully developed Android Native TaoBao app, we noticed much smoother and faster scrolling speed and effects compared to the previous simpler "native" apps. The performance characteristics of this version matches more closely to the official Play Store TaoBao, though with less CPU memory footprint.

Overall, the results still reflect what we had found in our previous benchmarking tests. The Makepad versions of the apps have consistently outperformed all other versions, at least in terms of pure scrolling tests.

## References

Makepad WeChat sample:
[`https://github.com/project-robius/makepad_wechat`](https://github.com/project-robius/makepad_wechat)

Makepad TaoBao sample:
[`https://github.com/project-robius/makepad_taobao`](https://github.com/project-robius/makepad_taobao)
Binary file added static/blog/cpu-cycles-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/blog/cpu-frequency-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/blog/cpu-memory-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/blog/gpu-memory-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/blog/scrolling-test-table-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed static/robius-logo.png
Binary file not shown.

0 comments on commit b069fe2

Please sign in to comment.