4 ms·
Ah, the reason you feel it's slow is because the server is located in Seoul, Korea. You're probably not in Korea, which is causing some network latency. If you
by Farer 2y ago
Ah, the reason you feel it's slow is because the server is located in Seoul, Korea. You're probably not in Korea, which is causing some network latency. If you try adjusting the map to a single spot and wait for a moment without moving it around, you'll notice it runs more smoothly.
I also want to mention that the map size is 245,760 x 138,240, which is exactly 128 times 1920 x 1080. I’ve managed to make that enormous map, along with the data for hundreds of thousands of weeds and countless rabbits, run smoothly without issues. It even works perfectly on mobile phones.
If I get the chance, I'll integrate Kafka and set up servers abroad.
- solardev 2y agoYes, some of it may be network lag (asset prefetching can help) but some of it is also just UI jank that has nothing to do with the network. I wouldn't really call it smooth compared to an optimized mapping lib like the other ones. Have you done any benchmarking by FPS, or even just noticing what happens visually when you pan (things blink in and out of existence, for example). Keep in mind that it's already more optimized than any code I could write on my own (kudos!), just not as smooth as the big solutions. If you don't want to use them, more power to ya! Just providing one opinion because you asked for it. Not necessarily trying to convince you to do it differently if you don't want to. Typically people will have made up their minds already anyway, lol.
- Farer 2y agoOkay, thanks. I have one question. What exactly do you mean by something disappearing and reappearing when panning? Could you explain the phenomenon in a bit more detail? Actually, when zooming in or out quickly, there’s a momentary effect where what was previously rendered lingers for a bit. I don't see this as a major issue, considering it aligns with the concept of eventual consistency. Also, what exactly is the large-scale solution you mentioned? Regarding the movement of the rabbits’ coordinates, it might not appear smooth when zoomed in significantly. This isn't necessarily a performance issue but rather something related to how the animals' coordinates are processed. I plan to improve that part in the future. Anyway, thanks for your interest. I'll definitely consider your feedback!
- solardev 2y ago> What exactly do you mean by something disappearing and reappearing when panning? Could you explain the phenomenon in a bit more detail? When you pan (click and drag, or touch and drag on a phone), all the bushes and the background disappear for what feels like a second or two, even if they're the same bushes as before. No network connections are happening during that pan, it's just a redraw that causes them to blip in and out: https://share.cleanshot.com/KvwXCVl7ZpLYk8KzFBN1 https://share.cleanshot.com/KvwXCVl7ZpLYk8KzFBN1 On Firefox the panning (before mouseup) is itself much laggier than Chrome. (Firefox generally has slower graphics, in my experience). It also suffers from the disappearing graphics on mouseup issue. Same thing happens if I zoom in and out, one mousewheel notch at a time - everything momentarily disappears before rerendering. > Also, what exactly is the large-scale solution you mentioned? By "big", I just meant literally the larger libraries I mentioned earlier (Leaflet, OpenLayers, OpenSeadragon, Konva, Pixi.js, etc.). They're bigger in both in popularity/mindshare, but also in filesize and complexity, which is what you're trying to avoid. However, they do have optimizations for the graphics rendering pipeline that maybe you can borrow from, if you look at their source code. Some examples: * https://openlayers.org/en/latest/examples/icon-sprite-webgl.html https://openlayers.org/en/latest/examples/icon-sprite-webgl.... (this one in particular is super smooth for me compared to your app's current version, but it uses WebGL) * https://openlayers.org/en/latest/examples/synthetic-points.html https://openlayers.org/en/latest/examples/synthetic-points.h... (demo without WebGL, much laggier) * https://konvajs.org/docs/sandbox/20000_Nodes.html https://konvajs.org/docs/sandbox/20000_Nodes.html * https://www.goodboydigital.com/pixijs/bunnymark/ https://www.goodboydigital.com/pixijs/bunnymark/ * http://fabricjs.com//group-dragging http://fabricjs.com//group-dragging * Benchmarks: https://github.com/slaylines/canvas-engines-comparison?tab=readme-ov-file https://github.com/slaylines/canvas-engines-comparison?tab=r... (current build seems broken)