# ScrollView+Image.Url performance test-case

**URL:** https://forums.fusetools.com/t/scrollview-image-url-performance-test-case/5494
**Category:** Bug Reports
**Created:** [December 21, 2015, 8:14pm UTC](https://forums.fusetools.com/t/scrollview-image-url-performance-test-case/5494 "2015-12-21T20:14:20Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![jveres](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/jveres/32/545_2.png) [@jveres](https://forums.fusetools.com/u/jveres)
#### Post date: [December 21, 2015, 8:14pm UTC](https://forums.fusetools.com/t/scrollview-image-url-performance-test-case/5494/1 "2015-12-21T20:14:20Z")

</div>

I put together this sample test-case for the team and anyone who’s interested. The scrollview displays a few (50 by default) image elements downloaded over Http.

There’s an animated loading indicator (spinner) which acts as the reload button as well. Simple.

Download from here: [https://fusecommunity.slack.com/files/jveres/F0H4PQE7J/gallerytest.zip](https://fusecommunity.slack.com/files/jveres/F0H4PQE7J/gallerytest.zip)

My bug report:

- on Android I get ~20fps
- on iOS I only get ~15fps, sometimes even less
- scrolling is jerky, especially during image download
- if you scroll the layout during the spinning animation you can get occasional frame drops
- ui becomes frozen sometimes for seconds on iOS

My questions:

- how could this code be improved to get 60fps on device?🙂
- what would be the best memory policy for image heavy apps?

thx

---

<div class="post-metadata">

### Author: ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)
#### Post date: [December 22, 2015, 9:43am UTC](https://forums.fusetools.com/t/scrollview-image-url-performance-test-case/5494/2 "2015-12-22T09:43:09Z")

</div>

Woah, that’s not 60FPS at all, is it?

Thanks for the test case, we will investigate.

---

<div class="post-metadata">

### Author: ![jveres](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/jveres/32/545_2.png) [@jveres](https://forums.fusetools.com/u/jveres)
#### Post date: [December 22, 2015, 3:52pm UTC](https://forums.fusetools.com/t/scrollview-image-url-performance-test-case/5494/3 "2015-12-22T15:52:24Z")

</div>

Just tested with the latest (5414) and things seems changed/optimized a bit. My observations:

- after the scrollview populated, the first tap causes huge lag but then it gets very responsive
- async image loading/drawing doesn’t seem to have lagging effect on the scrollview now
- after a few reloads the app gets killed with “Terminated with memory issue” on iOS
- playing with the app, I had an unwanted system restart on Android (no logs, unfortunatelly)

---

<div class="post-metadata">

### Author: ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)
#### Post date: [December 22, 2015, 4:07pm UTC](https://forums.fusetools.com/t/scrollview-image-url-performance-test-case/5494/4 "2015-12-22T16:07:41Z")

</div>

Thanks for the intel. We’ve had similar reports with reboot problems (wtf?) with the preview build. We’re on it!

---

<div class="post-metadata">

### Author: ![jveres](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/jveres/32/545_2.png) [@jveres](https://forums.fusetools.com/u/jveres)
#### Post date: [January 5, 2016, 1:07pm UTC](https://forums.fusetools.com/t/scrollview-image-url-performance-test-case/5494/5 "2016-01-05T13:07:14Z")

</div>

Just wondering if there’s any progress made on this. Digging the internals I found that `TextureLoader::ByteArrayToTexture2DContentType` causes the UI lags when called from `HttpImageSourceImpl::HttpCallback`.

---

<div class="post-metadata">

### Author: ![kusma](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/kusma/32/595_2.png) [@kusma](https://forums.fusetools.com/u/kusma)
#### Post date: [January 21, 2016, 9:13am UTC](https://forums.fusetools.com/t/scrollview-image-url-performance-test-case/5494/6 "2016-01-21T09:13:20Z")

</div>

This should have been mitigated by doing `TextureLoader::ByteArrayToTexture2DContentType` on a background-thread, and this fix will most likely be included in the 0.9.8 release. From my testing this helps a great deal. Please let us know if it doens’t help you.

---

<div class="post-metadata">

### Author: ![jveres](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/jveres/32/545_2.png) [@jveres](https://forums.fusetools.com/u/jveres)
#### Post date: [January 21, 2016, 9:56am UTC](https://forums.fusetools.com/t/scrollview-image-url-performance-test-case/5494/7 "2016-01-21T09:56:30Z")

</div>

Thanks Erik for the update and your efforts. I will let you know for sure.
