Skip to content

Commit

Permalink
chore: update measurements metrics to include flashlist comparison in…
Browse files Browse the repository at this point in the history
… readme
  • Loading branch information
azimgd committed May 19, 2024
1 parent 99093bc commit a667ca5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ It invokes Yoga for precise layout measurements of Shadow Nodes and constructs a
| Smooth Scrolling |||

## Scroll Performance
| Number of Items | ShadowList | FlatList Speed |
|------------------|----------------------------|----------------------|
| 100 (text only) | 108mb memory - 60fps | 164mb (38-43fps) |
| 1000 (text only) | 186mb memory - 60fps | 190mb (33-38fps) |
| Number of Items | ShadowList | FlatList | FlashList |
|------------------|----------------------------|----------------------|----------------------|
| 100 (text only) | **156mb memory - 60fps** | 195mb (38-43fps) | ~~180mb (56fps)~~* |
| 1000 (text only) | **187mb memory - 60fps** | 200mb (33-38fps) | ~~180mb (56fps)~~* |

> **FlashList is unreliable and completely breaks when scrolling, resulting in unrealistic metrics.*
> Given measurements show memory usage and FPS on fully loaded content, see demo [here](https://github.com/azimgd/shadowlist/issues/1) and implementation details [here](https://github.com/azimgd/shadowlist/blob/main/example/src/App.tsx).
## Installation
Add the package to your project via `yarn add shadowlist` and run `pod install` in the `ios` directory.
Expand Down
2 changes: 1 addition & 1 deletion example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default function App() {

return (
<SafeAreaView style={styles.safeareaview}>
<FlatListExample data={data} />
<ShadowListExample data={data} />

<Pressable style={[styles.item, styles.button]} onPress={loadMore}>
<Text>Load more</Text>
Expand Down
12 changes: 9 additions & 3 deletions example/src/sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,28 @@
}, {
"text": "Etiam ut nisi sem. Sed ornare sodales massa, a vulputate est luctus id.",
"username": "Maecenas laoreet"
},{
}, {
"text": "Cras eget turpis sed eros lobortis scelerisque. Proin quis lacus et ante malesuada cursus. Duis quis neque porttitor, feugiat augue non, molestie ex. Proin elementum euismod nisl, at scelerisque sem ullamcorper et. Duis dignissim pretium lacus vehicula congue.",
"username": "Etiam quis"
}, {
"text": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse potenti. Vestibulum tortor tortor, rutrum ut ante sed, tempus pellentesque dolor. Mauris tristique ultricies ultricies.",
"username": "Magna facilisis"
},{
}, {
"text": "Suspendisse eu gravida purus.",
"username": "Proin elementum"
}, {
"text": "Praesent vel enim non orci vulputate egestas eu quis libero.",
"username": "Habitasse platea"
},{
}, {
"text": "Sed convallis auctor nulla, at ultrices enim convallis nec. Integer enim dolor, sodales ac mi id, molestie congue enim. Aenean feugiat ullamcorper quam ac accumsan. Curabitur ut maximus massa, quis ornare magna. Sed tempor arcu nec congue molestie. Nullam interdum dui nunc, quis suscipit lorem varius eu. Vivamus at odio tellus. Nulla id diam at neque efficitur commodo. Nam faucibus lorem vitae tortor egestas, eu dignissim turpis rutrum. Donec lacinia eros purus. Praesent tincidunt, ipsum vitae commodo iaculis, ex velit imperdiet augue, quis tempus erat orci at enim. Morbi sit amet viverra mi.",
"username": "Nunc euismod"
}, {
"text": "Cras eget turpis sed eros lobortis scelerisque. Proin quis lacus et ante malesuada cursus. Duis quis neque porttitor, feugiat augue non, molestie ex. Proin elementum euismod nisl, at scelerisque sem ullamcorper et. Duis dignissim pretium lacus vehicula congue.",
"username": "Etiam quis"
}, {
"text": "Sed nunc enim, tristique id commodo id, lobortis id quam. Pellentesque pellentesque lacus vel leo interdum, vitae dignissim tortor tincidunt. Sed tristique vel arcu sit amet condimentum. Cras a dolor eget erat aliquet condimentum sit amet interdum ligula. Duis tincidunt laoreet velit quis placerat.",
"username": "Fusce vitae"
}, {
"text": "Cras eget turpis sed eros lobortis scelerisque. Proin quis lacus et ante malesuada cursus. Duis quis neque porttitor, feugiat augue non, molestie ex. Proin elementum euismod nisl, at scelerisque sem ullamcorper et. Duis dignissim pretium lacus vehicula congue.",
"username": "Etiam quis"
}]

0 comments on commit a667ca5

Please sign in to comment.