ASGAlex / flame_tiled_utils

A set of useful utils to extend tiled functionality
MIT License
8 stars 3 forks source link

UI thread performance improved but the Raster thread performance is significantly decreased #2

Closed Hwan-seok closed 1 year ago

Hwan-seok commented 1 year ago

I tested this package on my map because most of my maps are very big. In the beginning, I am very excited because the execution time of render() and update() is significantly decreased. But after some performance testing, I found it drops the FPS from 60 to 20. So I tested through performance view and found something that the UI thread time is decreased but Raster thread time is more increased than the former one.

As usual

https://user-images.githubusercontent.com/38072762/191893936-988f5181-1db3-4dde-b0a6-0c0e38df09c2.mov

스크린샷 2022-09-23 오후 1 35 48

Using this package

https://user-images.githubusercontent.com/38072762/191893930-081be481-a284-4308-8ee7-a7c8ce88734e.mov

FYI,

ASGAlex commented 1 year ago

I'm afraid there is no way to change anything here. Yes, everything is ok in your example.

Layers compilation simple creates new Image from tiled map, it saves your update() time by forcing system to render one big image inside position component.

You can achieve same behavior trying to save your map's layers into Image and then to render it through SpriteComponent. Would it work fast on your machine or you would face same problem with raster layer?

Hwan-seok commented 1 year ago

Thanks for the answer Does this issue only apply to specific maps? Is yours OK with this?

ASGAlex commented 1 year ago

I think there could not to be any special related to map format. Every map ends up as Image or group of Images wrapped to PositionComponent(s). Technically it is like if you would use SpriteComponent directly,

Anyway you cause is interecting. May be you hardware can't to work with big images but would be faster if images would be split into smaller parts. It is a point to experiment with.

ASGAlex commented 1 year ago

I am going to close this issue becouse it is impossible to fix it with current library's architecture. It is "corrupted by design". I'd recomment to try it's successor instead, https://github.com/ASGAlex/flame_spatial_grid. It provides the same features for tiles processing, but without generating an extra-large images.