Skip to content
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 issues #120

Open
giaur500 opened this issue Feb 15, 2023 · 88 comments
Open

Performance issues #120

giaur500 opened this issue Feb 15, 2023 · 88 comments

Comments

@giaur500
Copy link

giaur500 commented Feb 15, 2023

I noticed performance when zooming/moving is actually poor in compare to native solutions like Google Maps or Mapbox official api. On low end devices map is almost unusable.

From other side, raster tiles from flutter map plugin are still very fast. Are you aware performance issues and is there anything possible to make it working faster?

@FaFre
Copy link
Contributor

FaFre commented Feb 15, 2023

If you are interested, there are some past conversations in the closed issues where you can have a read and might add some ideas. The tile rendering (drawing on canvas) is currently only possible in the flutter main isolate (flutter/flutter#75755), when I'm not mistaken this is still the bottleneck.

You can improve performance by tuning your style. Feel free to do your own experiments and share it with us :)

@greensopinion
Copy link
Owner

We've done a lot of work to address performance issues, but it's still not as good as raster or native maps. Poor performance is most noticeable with tiles having a lot of data (e.g. in LA or London).
You can find previous discussions by searching for other issues

The theme can make a big difference as noted by @FaFre (thanks!) but you may find that raster tiles are needed to get the performance that you want, depending on your use-case.

I've added some examples that you may find helpful here: https://github.com/greensopinion/flutter-vector-map-tiles-examples
There are two custom themes in there that may help with performance.

@giaur500
Copy link
Author

As far as I understand, currently is not possible to optimize it becuse of Flutter limitations? Ok, I will try themes, Indeed, a lot of data causes poor performance.

@FaFre
Copy link
Contributor

FaFre commented Feb 17, 2023

@greensopinion I pushed the flutter issue and got a response that flutter_isolate plugin might improve performance and gain access to dart ui: flutter/flutter#75755 (comment)

However, this plugin is only Android/iOS compatible, do you see any chance this would improve the current performance?

@greensopinion
Copy link
Owner

greensopinion commented Feb 18, 2023

Yes, there's a good chance that it could be used to offload some CPU-intensive tasks off the UI thread. We are already offloading some work to isolates, but there are many things that can't be offloaded due to use of dart:ui.

I imagine that the easiest and most beneficial thing to do would be to render a raster image on an isolate. This could either be integrated directly with the existing flutter_map raster tile capabilities, or perhaps in vector_map_tiles. The idea would be to render vector tiles as images and supply those to flutter_map. The benefit over using raster tiles directly would be choice of themes client-side, and rendering tiles at higher zoom levels that aren't normally available. At 2x (retina) size raster tiles look pretty sharp, but we could even render tiles at incremental zoom levels (e.g. a tile at 14.25 zoom instead of 14 then scaled to 14.25)

I'm a little reluctant to invest in functionality that is using officially unsupported flutter/dart capabilities, such as dart:ui on non-UI isolates. As noted on flutter/issues/75755 things may already break with Impeller.

If we consider moving forward with this idea, we should first evaluate how Impeller affects performance. For example, a comparison running the example library in the profiler with Impeller and without would be really helpful.

@giaur500
Copy link
Author

@greensopinion do you think it's possible to disable Impeller and use isolates on Android only?

@greensopinion
Copy link
Owner

At least for now it's possible - but that will likely change once Flutter fully adopts Impeller since they won't want to maintain two separate rendering frameworks for Android indefinitely.

@giaur500
Copy link
Author

I don't know how much work is it, but I think better to use isolates on Android, even as temporary solution. Still more than nothing.

@greensopinion
Copy link
Owner

However, this plugin is only Android/iOS compatible, do you see any chance this would improve the current performance?

I've pushed an experiment to https://github.com/greensopinion/flutter-vector-map-tiles-raster-experiment
Feel free to try it out!

@giaur500
Copy link
Author

It works pretty fast, almost the same performance as native Google Maps. Very good result in my opinion. Not tried on iOS though

@aamirki
Copy link

aamirki commented Mar 8, 2023

Hey I just tried out that experiment on iOS and the performance is really good!

@giaur500
Copy link
Author

giaur500 commented Mar 9, 2023

After more testing. It seems to be better, but still not as good as rester map or native maps like Google Maps. I will test without any style applied to see how does it work, possible only style applied causes better performance

@greensopinion
Copy link
Owner

I've created a branch in this repository for experimentation: flutter-vector-map-tiles/tree/raster-experiment

There are a few things needed to take it further:

  1. there may be a memory leak
  2. the API is unnatural and needs revisiting
  3. there is no way to plug in rendering in a separate isolate
  4. tuning

@Pepslee
Copy link

Pepslee commented Mar 26, 2023

However, this plugin is only Android/iOS compatible, do you see any chance this would improve the current performance?

I've pushed an experiment to https://github.com/greensopinion/flutter-vector-map-tiles-raster-experiment Feel free to try it out!

It works really cool. But there is some problem in my case. When I'm panning for a long distance it seems that a huge number of isolates creates for all panned tiles. Seems like tile provider doesn't drop deprecated isolates for tiles which was rapidly panned. For example, I have 100 tiles on the map and I`m trying to pan from 1 tile to 99 tile by one swipe. Tile provider starts to create 99 isolates and tries to process them all but not just skips unnecessary tiles and process only several last tiles.

@greensopinion
Copy link
Owner

The experiment is only intended as a proof-of-concept. There is a lot of work needed to make it ready for real usage.

I've been working on #129 to introduce raster images as an alternative to vectors. Raster images have the advantage of improved frame rate (less jank) and they only need to be rendered the first time since they can be stored in the cache for future use. The result is quite good. Of course, raster images aren't as sharp at fractional zoom levels. #129 is now available as version 3.3.0 of this library.

@Pepslee
Copy link

Pepslee commented Mar 27, 2023

The experiment is only intended as a proof-of-concept. There is a lot of work needed to make it ready for real usage.

I've been working on #129 to introduce raster images as an alternative to vectors. Raster images have the advantage of improved frame rate (less jank) and they only need to be rendered the first time since they can be stored in the cache for future use. The result is quite good. Of course, raster images aren't as sharp at fractional zoom levels. #129 is now available as version 3.3.0 of this library.

Thank you, I have already tried this update, it work really faster, but I still have freezes ((. In any case any calculation in main thread entail freezes of the UI. Even if they won't be visible for the human eye, but they will still affect any timer or animation in app.
I hope this problem will be solved with impeller, and there will be a mechanism for rendering in non main thread.

@JaffaKetchup
Copy link
Contributor

@greensopinion
Copy link
Owner

greensopinion commented Apr 5, 2023 via email

@JaffaKetchup
Copy link
Contributor

@greensopinion Both. Probably not a massive performance improvement, but there is a chance it will help. There are major API changes - but I'm not sure if any of them will affect you. Probably the most major for plugin maintainers is the renaming of Coords to TileCoordinates.

@greensopinion
Copy link
Owner

Thanks @JaffaKetchup - created #136 in preparation for flutter_map major version change.

@mdmm13
Copy link

mdmm13 commented Oct 3, 2023

Hey @greensopinion, was trying to follow up on your discussion here about using flutter_isolate to offload processing yet still able to call dart.ui functions outside the main isolate. It's not the full solution I understand from your comment here, but part of it. The other part being the complexity of the theme, which you're trying to solve by selectively delaying the rendering if I understood correctly.

I'm not sure I got it right, but per nmfisher's (flutter_isolate maintainer) last comment here, the status on this PR being merged into dart's main branch and the comment here, it appears that the functionality that Impeller previously blocked on iOS should now be back again with Dart 3?

Does this mean, flutter_isolate + selective delays COULD solve many of our performance issues? What am I missing?

@DavidDohmen
Copy link

Hey, @greensopinion - have you considered drawVerticesRaw for rendering? It seems to be orders of magnitude faster than using widgets or canvas.
This video explains it very thoroughly and the bookmarked section shows a comparison between the different methods;
https://youtu.be/pD38Yyz7N2E?t=742

@mdmm13
Copy link

mdmm13 commented Oct 30, 2023

Hey, @greensopinion - have you considered drawVerticesRaw for rendering? It seems to be orders of magnitude faster than using widgets or canvas. This video explains it very thoroughly and the bookmarked section shows a comparison between the different methods; https://youtu.be/pD38Yyz7N2E?t=742

Would probably solve all problems with vector maps without going GL?

@JaffaKetchup
Copy link
Contributor

Just for context, we're looking into potentially using drawVertices to draw polygons in FM, but that's still in mostly private discussion.
You may also be interested in dart_earcut (self-promo :D), which will perform the triangulation needed for drawVertices extremely quickly (it doesn't work well on self-intersecting polys, they'll need to be simplified into multiple simple polys).

@greensopinion
Copy link
Owner

Looks promising! Feel free to prototype something.

@DavidDohmen
Copy link

Unfortunately I have neither the time nor skillset to do so. We would however contribute financially with a bounty, if a certain speed level is reached, because then flutter_map would become feasible as an alternative to mapbox for us.
So if anyone with the right skillset wants to pick this up, let's talk!

@j-bbr
Copy link

j-bbr commented Dec 12, 2023

I might be able to spend some time on this in the near to medium term. So I was wondering, first of all, whether somebody is already working on this or on similar things with drawVertices in FM as @JaffaKetchup mentioned?

@JaffaKetchup
Copy link
Contributor

@j-bbr Right now we are not implementing drawVertices, and if we do, it'll be for Polygons only: we have no plans to make a vector layer for now.

@mdmm13
Copy link

mdmm13 commented Feb 8, 2024

Let me unpack, you have a lot of points where I'm not always sure if or how they relate.

When I say "GPU", I really mean native and what I presume is better GPU access to explain the massive performance differences, apologies for that.

All other Flutter vector maps use the GPU, either via native, webview, etc.

You mean mapbox-gl and maplibre-flutter? I've only briefly looked into their implementations. Does anyone do CPU-only rendering?

Yes, I do mean flutter-maplibre-gl (layer on top of native/gl_js), HERE (layer on top of native), Google Maps, ... all the vector ones that somehow perform well. Haven't looked at their native implementations though.

As you stated fleaflet/flutter_map#1800 (comment) though, it'll be a while until we get GPU access through Flutter.

Right, importantly though 'low level' GPU access. When using flutter, depending on your engine backend, you're certainly using the GPU.

Yes, of course :)

maplibre-rs would be fantastic, but the WebGPU standard is still being developed and WEB performance there is also not great (yet) and it's going to be a while before that's an option.

I can't comment on the web performance of maplibre-rs, the desktop performance seemed fine. I'm not sure why you're bringing up WebGPU. I assume that maplibre-rs would use WebGL on web. It has a variety of backends. It presumably used vulkan or OpenGl when running on my desktop: https://github.com/maplibre/maplibre-rs/blob/095d5fbbfb0fea4bfa680e9534944813447b220e/README.md?plain=1#L57 . Is there any concern I'm missing?

I thought you were talking about the maplibre-rs PoC (from the maplibre-rs Github: "maplibre-rs is a portable and performant vector maps renderer. We aim to support web, mobile and desktop applications. This is achieved by the novel WebGPU specification."). No concerns if you're going for the GL ones.

Maybe the answer is that pure Flutter vector performance will only catch up in 2025 (?).

Catch up to what? Is your statement regarding canvas-based rendering and the respective cross-platform backends using skia (wich has both a OpenGl and Vulkan beackend), impeller (which is Vulkan only?), ... ?

I'm referring to the other vector maps that perform surprisingly well in Flutter. That's the key question I believe most people are trying to answer when choosing between flutter_map + vector plugin and the ones mentioned above.

After your experiments, do you think there's a play here to get vector to perform without GPU?

I think there's a play with not rendering and frequently re-rendering vector tiles synchronously on the raster thread's frame generation path.

Got it, thank you.

Regarding with or w/o GPU, when you use Picture.toImage to rasterize a Picture (canvas + ops) what makes you think you'd not be using the GPU? Ultimately, it depends on the flutter engine's implementation. I can't tell you for sure if and when it would fall back to a purely CPU-based rasterizer if ever. Skimming the implementations, impeller seems to always be using the GPU, the Skia backend is a lot more conditional: https://github.com/flutter/engine/blob/6d524588c0f9a4c73142f8659e8f113e6e6492ce/lib/ui/painting/picture.cc#L42 (it looks like i may depend on thread locals, i.e. which thread you're running on, etc)

As per my original clarification above. I'm aware Flutter uses the GPU :)

Ok, David's quote is: "I have a tough time imagining a good user experience if maps have features appearing/disappearing while zooming or panning."

I agree 100% with David. To be clear, https://maps.earth/ does not do that either. When a tile is loaded and you zoom a little the tile stays on screen. Imagine you zoom and the already loaded tile would vanish to then come back a few frames later. You might be thinking about the initial first render. Sure that can happen whenever and that's already the case.

Alright, then I misunderstood. From the various Flutter links I shared, to me the logic was: (A) we've got tons of drawX calls beyond the 100 or so that 1 post mentioned as a performance drop-off point (B) with vector we can choose to delay rendering layers until others are done (C) I'd personally rather have performance and something looking a bit "weird" with layers like text and polygons if that was a trade-off that was on the table.

@greensopinion
Copy link
Owner

@ignatz

I spent a bit more time doing some more draw batching. ...
I did clean up my changes a bit, in case folks would like to join: https://github.com/ignatz/dart-vector-tile-renderer/commits/draw_less_smile_more/

I took a quick look over your changes, they look really good. A few questions:

  • do you have metrics on batching, i.e. the average batch size?
  • do you have a repeatable method for measuring improvements?
  • have you looked at whether transparency (e.g. in the line color) works well with drawVertices?
  • how is your "clings on to tiles" layer different from using raster mode?

@ignatz
Copy link

ignatz commented Feb 9, 2024

do you have metrics on batching, i.e. the average batch size?

I looked a bit into it. The batches can get large containing sometimes hundreds or over a thousand geometries. I don't think average is a good metric here since it will depend a lot on the tiles (provider, zoom level, where and even styles).

do you have a repeatable method for measuring improvements?

Not a good one, since there are so many variables. I did share my little clips which I tried to keep things the same. That said, panning is the most reproducible but certainly the cheapest.

have you looked at whether transparency (e.g. in the line color) works well with drawVertices?

I have not. I certainly did see visual glitches (e.g. some islands would be fully transparent at certain but not other zoom levels). I'm not ready to blame draw vertices, since this might as well be an issue with my changes. That said, I've been going back and forth on batching vertices and batching paths (which didn't show the same glitches) and both are significant improvements.

how is your "clings on to tiles" layer different from using raster mode?

I didn't want to ignore you, I just thought your question was racing my reply. To quote myself:

When I mentioned tile lifecycles, I really just meant we need to hold on to the tiles and simply not re-render them. I'm also lazy so I didn't really write my own tiling layer. What you're seeing is FlutterMap's default tiling layer with a TileProvider that renders vector tiles into images with an extra Symbol/Text only layer on top. Just like in David's implementation the cost of the labels is simply mitigated by taking them off screen while rotating and zooming. When they finally pop in, the rendering janks terribly but you just don't see it on an otherwise static screen.

You could consider this "cheating" in terms of vectors. At the end of the day, anything works that leads to less synchronous (re-)renders on the raster thread. Another "cheating" but promising avenue is to simply render fewer bigger tiles at zoom level minus N.

@greensopinion
Copy link
Owner

greensopinion commented Feb 9, 2024 via email

@ignatz
Copy link

ignatz commented Feb 9, 2024

Maybe you're expecting too much :). I'm rendering into an Image because that let's me control the lifecycle. You're drawing into a CustomPaint widget. RepaintBoundary gives one some limited, best-effort lifecycle control, which you're using to prevent re-renders when panning. However when you're zooming or rotating, you're re-rasterizing on every frame

@greensopinion
Copy link
Owner

greensopinion commented Feb 9, 2024 via email

@ignatz
Copy link

ignatz commented Feb 9, 2024

Shame on me, digging through all the layers I actually missed that switch. I took a quick look and unsurprisingly the performance in raster mode is much much better.
In that case the only difference is that I'm rendering labels and tiles in separate passes, i.e. the labels (un)rotate independent from the tiles.

@greensopinion
Copy link
Owner

greensopinion commented Feb 9, 2024 via email

@ignatz
Copy link

ignatz commented Feb 9, 2024

Agreed. I also never wanted to imply any of it is rocket science. I did it because tapping into the existing FlutterMap tilelayer infra I could do it with rather little effort.
FWIW, I do think that the hybrid approach helps with selling the "illusion" or at least reclaiming some of the vector map benefits, see:

Screencast.from.2024-02-09.16-38-24.mp4

@JaffaKetchup
Copy link
Contributor

I have just had a little experiment with a custom Mapbox style, and noticed that setting VectorTileLayerMode.vector actually gave considerably better performance on my computer than the raster mode. It may be worth revising the documentation.

@greensopinion
Copy link
Owner

That's cool @JaffaKetchup - can you quantify it?

@j-bbr
Copy link

j-bbr commented Feb 20, 2024

I've put a profiling / integration test for vector maps based on this example from the documentation in this repository here. The test simulates map interaction (moving the map, zooming in, flinging the map again, zooming out etc) and records performance related data in a summary (examples attached) and an event trace .json file. The trace file can be viewed with chrome://tracing (see image)
ChromeProfiling It should be straightforward to change the map vector style, map starting location, vector vs. raster mode, package version (released or from git branch / revision ) and get reproducible, comparable results.

As an example I've attached 2 summaries, profiled on a Samsung S20, using the Stadia Maps OSM Bright style once in vector and once in raster mode and moving / zooming over Tokio.
tokio_map_timeline.timeline_summary_raster.json
tokio_map_timeline.timeline_summary_vector.json

@greensopinion
Copy link
Owner

@j-bbr that's really cool! Having a repeatable way to produce profiling data could help to drive improvements. It's always a challenge to know if a change makes a difference. Do you plan to improve it further?

@j-bbr
Copy link

j-bbr commented Feb 26, 2024

Yes, I would like to and I'm open to input for next steps as well. At the moment I am still wondering which metrics are most insightful to compare. For vector mode it's fairly straightforward to see that the frame rasterizer times are above the 16 ms budget for smooth 60 fps but in the raster mode its more difficult to tell from the timelines since the delay happens of the UI-thread.
I think it would be great too if this could ultimately be done in CI (Firebase Test Lab or similar) but unfortunately it doesn't seem very straightforward.

@JaffaKetchup
Copy link
Contributor

@j-bbr It would be awesome if you could make a version without the vector tiles stuff, and it would be much appreciated as a test in FM core!

@mdmm13
Copy link

mdmm13 commented Feb 29, 2024

Just FYI, interesting debouncing support being added to the core flutter_map, to drive performance for lower-end devices and web. Great video showing impact here.

Might be worth checking out for vector also, since the best performance optimization is doing less computations in the first place.

@Hellomik2002
Copy link

I am not sure but maybe it can be helpful? https://pub.dev/packages/dart_ui_isolate
@chipweinberger Released new plugin

@greensopinion
Copy link
Owner

Just FYI, interesting debouncing support being added to the core flutter_map, to drive performance for lower-end devices and web. Great video showing impact here.

Thanks @mdmm13 that's helpful! I'm curious as to why the default debounce is 0ms.

Would you be interested in submitting a PR? A good place to start: https://github.com/greensopinion/flutter-vector-map-tiles/blob/main/lib/src/grid/grid_layer.dart#L144

@JaffaKetchup
Copy link
Contributor

I'm curious as to why the default debounce is 0ms.

We decided 0 was best as it the feature does impact functionality a fair amount. New tiles aren't loaded at all until the debounce is complete: a long fling will not load any tiles, for examples.

@greensopinion
Copy link
Owner

I am not sure but maybe it can be helpful? https://pub.dev/packages/dart_ui_isolate @chipweinberger Released new plugin

@Hellomik2002 cool to see more options come up. Do you have any idea how this would be an improvement over flutter_isolate?

We've prototyped something with flutter_isolate which makes interactions glassy smooth - but it needs work before it could be useful in a real app. Feel free to try it out replacing flutter_isolate with dart_ui_isolate.

@ignatz
Copy link

ignatz commented Mar 4, 2024

Since dart_ui_isolates came up, I'm going to share my vector tile layer: https://github.com/ignatz/vector_tile_it/tree/main/example .

It contains all the optimizations mentioned before and is just generally a bit less layered. That said, it's pretty untested and I'm sure that my wild experiments introduced some regressions. I'm not using it productively myself since I'm still contemplating switching to a rust based rasterizer (at least for the tiles).

Enough disclaimer, I played with flutter_ui_isolate to see how much of an impact it has. That said, it's important to note that flutter_ui_isolates are only supported on android, ios and osx. So if you wanna play around with it, it can be easily disabled.

Do you have any idea how this would be an improvement over flutter_isolate?

The two main differences are that they have less memory overhead and you can use dart:ui (flutter/flutter#10647). Based on the issue I would have naively expected you to encounter issues but maybe things have improved since the bug was filed in 2017 🤷‍♀️

@mdmm13
Copy link

mdmm13 commented Mar 7, 2024

Thanks @mdmm13 that's helpful! I'm curious as to why the default debounce is 0ms.

Would you be interested in submitting a PR? A good place to start: https://github.com/greensopinion/flutter-vector-map-tiles/blob/main/lib/src/grid/grid_layer.dart#L144

Sure, but won't it automatically be added as soon as flutter_map gets released as v6.1 or v7? It's already been merged into master there?

@Soap-141
Copy link

Soap-141 commented Mar 7, 2024

Someone know when it will be available?

@greensopinion
Copy link
Owner

Since dart_ui_isolates came up, I'm going to share my vector tile layer: https://github.com/ignatz/vector_tile_it/tree/main/example .

@ignatz very cool to see how you were able to integrate the renderer with very little code. vector_map_tiles suffers from code complexity due to the many iterations it took to evolve and my many hacks. If you've learned anything that you would like to see make it back into vector_map_tiles let me know.

@ignatz
Copy link

ignatz commented Mar 8, 2024

I'm not quite sure what you have in mind. Don't get me wrong, I'm super appreciative of the work that you've done especially for vector_tile_renderer but I wrote my own tile layer on top because I didn't think it was possible for me to make the changes I wanted to make to vector_map_tiles.

You can certainly pull in my changes to vector_tile_renderer, they should benefit any user and were some -70% reduction for Mapbox terrain maps (I don't even remember anymore).

As for the tile layers, I'm not sure what "I would like to see make it back" or how that would work. My layer takes the hybrid approach: rasterized terrain with crisp vector labels and symbols, has pretty much all I'd expect from a tile layer, and is ~1/3 the code. At the expense of sounding accidentally presumptuous, if you're not happy with the state of vector_map_tiles, I'd love for you to take ownership in vector_tile_it (the name is negotiable :) )

Also to be clear, my initial excitement has worn off a bit. I'm not sure that even with all these improvements and changes, flutter-canvas-based vector tiles would meet my personal performance goals. As I've mentioned before, I've toyed with the idea of pushing the rasterization to a mapboxlibre-rs renderer 🤷‍♀️. But even then it wouldn't be true vector maps but rather faster raster maps with vector labels. I certainly don't get the point of rasterizing everything, why wouldn't I just use raster map tiles? (I guess if you really wanted to change the styling on the client but that sounds rather niche)

@mdmm13
Copy link

mdmm13 commented May 15, 2024

Tessellation or not, the issue you linked sounds very relevant and plausible: flutter/flutter#131345 . If that was the case, we're not talking bugs but rather crappy implementation. According to the issue, a solution is on halt for "higher priority" work. (tangential rant: gotta love flutter government, hope they'll eventually hand it over to a foundation). Meanwhile, playing with the blending might provide some insights 🤷‍♀️

Just FYI, Flutter 3.22 appears to improve tessellation issues drastically. Might help.

@ignatz
Copy link

ignatz commented May 15, 2024

I just quickly ran 3.19 and 3.22 side-by-side. I wasn't sure if Linux was also using the new vulkan-based impeller renderer, looking at the output I'm leaning yes:

Screenshot from 2024-05-15 10-42-09

Maybe worth waiting a few fixes :hide:

Also worth highlighting from the article you linked:

While pleased with these improvements, there is still more work to do. Among other opportunities, we are aware that polyline generation remains prominent in CPU profiles, and we intend to investigate shifting this work to the GPU, as well.

@mdmm13
Copy link

mdmm13 commented May 16, 2024

I just quickly ran 3.19 and 3.22 side-by-side. I wasn't sure if Linux was also using the new vulkan-based impeller renderer, looking at the output I'm leaning yes:

Thank you for the quick check - looks like a 20-30% performance improvement on average.

Also worth highlighting from the article you linked:

While pleased with these improvements, there is still more work to do. Among other opportunities, we are aware that polyline generation remains prominent in CPU profiles, and we intend to investigate shifting this work to the GPU, as well.

The fact that they're stating that in the official announcement means that they're probably working on it :-)

@Hellomik2002
Copy link

I'm not quite sure what you have in mind. Don't get me wrong, I'm super appreciative of the work that you've done especially for vector_tile_renderer but I wrote my own tile layer on top because I didn't think it was possible for me to make the changes I wanted to make to vector_map_tiles.

You can certainly pull in my changes to vector_tile_renderer, they should benefit any user and were some -70% reduction for Mapbox terrain maps (I don't even remember anymore).

As for the tile layers, I'm not sure what "I would like to see make it back" or how that would work. My layer takes the hybrid approach: rasterized terrain with crisp vector labels and symbols, has pretty much all I'd expect from a tile layer, and is ~1/3 the code. At the expense of sounding accidentally presumptuous, if you're not happy with the state of vector_map_tiles, I'd love for you to take ownership in vector_tile_it (the name is negotiable :) )

Also to be clear, my initial excitement has worn off a bit. I'm not sure that even with all these improvements and changes, flutter-canvas-based vector tiles would meet my personal performance goals. As I've mentioned before, I've toyed with the idea of pushing the rasterization to a mapboxlibre-rs renderer 🤷‍♀️. But even then it wouldn't be true vector maps but rather faster raster maps with vector labels. I certainly don't get the point of rasterizing everything, why wouldn't I just use raster map tiles? (I guess if you really wanted to change the styling on the client but that sounds rather niche)

publish it, let's see it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests