unitycoder / UnityMobilePaint

Public repository for MobilePaint issues & requests
https://www.assetstore.unity3d.com/en/#!/content/19803?aid=1101lGti
MIT License
49 stars 16 forks source link

Flood Fill optimization for IL2CPP #42

Open muhammadtahir08 opened 4 years ago

muhammadtahir08 commented 4 years ago

Actually flood fill works fine until you are working with mono scripting back-end when you switch to IL2CPP then flood fill makes the app very slow so i think there will be a way to optimize this algorithm. i am using FloodFillMaskOnlyWithThreshold

unitycoder commented 4 years ago

does profiler show what makes it slower in il2cpp?

but i'd suggest trying to do the pixel collecting part in another thread, and using something better than queue: https://github.com/unitycoder/UnityMobilePaint/issues/41

muhammadtahir08 commented 4 years ago

I have tried both Scripting back-end IL2CPP and Mono Scripting back-end when i use mono scripting back-end it works fine on the other hand when i switch to IL2CPP totally negative results. i also attached screenshot while i was observing on mobile its shows that mobile paint flood takes almost 5k+ cpu clock cycle to execute it. the screenshot taken i used the flood fill. Queue having BigofO(1) for insertion and deletion. so i think main problem is that what happen when we convert it to IL2CPP, while it works fine on Mono scripting back-end. colorpuzzle_profiler