-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance issue - Main isolate is blocked when encoding geojsonFeature #366
Comments
A spontaneous idea (not saying this is necessarily better, but might be simpler): could we just expose an ("advanced") variant of the method that accepts a pre-encoded string, such that library consumers can decide how they want to do the json encode (e.g. on another isolate) |
Yes this would also work, and I don't see any performances differences between the two solutions.
My point of view, is that the package |
I even think that The same goes for other methods. |
@m0nac0 I'm staring to think that your idea is better. Package user that display list of complexe polylines, should be able to do all that with one compute. And for that, the package needs to expose a lowLevel method, that accept encodedGeoJson. I will try to expose a method |
Before sending geojsonFeature through the method channel, the data is encode.
![Untitled-8](https://private-user-images.githubusercontent.com/28344195/296507682-187cde77-fc8b-4fc3-b7ff-5f270d884e4f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4MzE2MTYsIm5iZiI6MTczODgzMTMxNiwicGF0aCI6Ii8yODM0NDE5NS8yOTY1MDc2ODItMTg3Y2RlNzctZmM4Yi00ZmMzLWI3ZmYtNWYyNzBkODg0ZTRmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA2VDA4NDE1NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY2NTllYTlmMDk4OTY5NTg4ZGFlOTFiMjdmNDhmZjhlNWVkNzU0YTg4ZDZlNzA2ZWZiY2IzNWE4MjY3ZWY0OTMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0._xsV0tiFPB7lIIM6GIaVE4d_MvJglVg6JKeqUvzdqeM)
Ex:
the function
jsonEncode
is synchronous, and if the is a lot of data, like a line of 40k points, the main isolate can be blocked.This can lead to a UI freezed of n-seconds on the Flutter side.
See FlameChart:
![Untitled-9](https://private-user-images.githubusercontent.com/28344195/296507807-e32e8b78-63cb-4d62-bc01-b39b818617f8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4MzE2MTYsIm5iZiI6MTczODgzMTMxNiwicGF0aCI6Ii8yODM0NDE5NS8yOTY1MDc4MDctZTMyZThiNzgtNjNjYi00ZDYyLWJjMDEtYjM5YjgxODYxN2Y4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA2VDA4NDE1NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA4OWYwNzYzZWZmMGY1M2MzOTVhMzY4OTk5NDAwNDY0MGUxYjQ1NzVhMGIwNzRkMWYzZWY1M2ZjOWU0MTVhMWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.4MgaolyyrwFv1OBbUkK9UtIOUSBQFc4vtupKEI-2J5A)
The text was updated successfully, but these errors were encountered: