WebCanvas update speed when canvas is already populated

Chris I’ve read You basically try to get a calendar view with this? maybe a look on Jeremy’s web calendar control would help. He has managed this issues and I am using it in my projects without hassle.

Tomas, Thanks for the advice. I have purchased Jeremy’s controls in the past. Unfortunately the control I am trying to implement is at a basic level a calendar view but at a more advanced level a sophisticated dashboard that displays all manner of feeds and data. His calendar view simply wont do what I need.

Assuming Jeremy used a canvas to create his calendar view, I wonder if he could answer how he managed to speed it up? Does his calendar view handle upwards of 500 drawn elements in less than 1 second?

Updated the project in feedback (38880) to demonstrate speed improvements.
I have added two counters to determine how long things are taking.
I do not believe the results are accurate though - is the ms property wrapping? unless once again its the diff algo taking the time to display the content?
One counter starts when the button is clicked.
The next starts when the canvas paint event fires.
I typically get 150ms ish and 30ms ish respectively but the full refresh takes over 1 second when timed with my phone for an 8X30 grid ie until I see something on my screen.

Not bad considering I initially had 45 -75 second reloads just invalidating the canvas a few days ago.

Well…even if I resolve the ToString issue, I don’t think the time will be <1s for setup with your max size grid. (Would be for text updates.)

HTML in a viewer didn’t work out? What about WebListBoxTD? How much formatting/HTML do you need per cell?

With my last update I have found 30 rows to be on the limit of acceptable. This will account for 14.5 hours at 30 Min resolution. If Greg can find something to speed it up and xojo implement it in the next update we might be ok. Hah! Who am I kidding.

97 rows is about 1.5 seconds with this method (as opposed to 150 for a simple invalidate) so there must be some improvements in the back end where the canvas is refreshed vs initially drawn.

HTML viewer I have not played with yet but I would need to generate html with formatting for cells. It gets tricky when you need to work out which square you clicked on with just x, y coords. Does the html viewer accurately display dimensions? I know I can rely on the canvas to do this. (see last test app I uploaded).

The cells will display all kinds of info from booking names, staff, room, paid/unpaid, events, to do actions and it goes on. When a user switches between functionality it needs to change to formats other than just grids. I am also using a canvas as a dashboard. This does not need to be updated regularly or even in less than a second but the complexity of the layout seems to be processor intensive - this worries me as I try to cram as much meaningful info into a square as possible in my calendar type layout.

[quote=179533:@Chris Musty]Tomas, Thanks for the advice. I have purchased Jeremy’s controls in the past. Unfortunately the control I am trying to implement is at a basic level a calendar view but at a more advanced level a sophisticated dashboard that displays all manner of feeds and data. His calendar view simply wont do what I need.

Assuming Jeremy used a canvas to create his calendar view, I wonder if he could answer how he managed to speed it up? Does his calendar view handle upwards of 500 drawn elements in less than 1 second?[/quote]

I think Jeremy is not using WebCanvas at all… and I can confirm that more than 500 items are shown quite fast. Have you take into consideration that WebCanvas might be not the right solution for you then?

What about custom webContainers or even Listboxes? I’ve uploaded to images of two projects of mine:

The first one is a WebContainer, the one below is just a Listbox used as Scheduler…
Live version can be test drived here: http://hangarbox.de/hangarboxserver.cgi

Keep in mind that whatever we do, you will still need to account for transmission time. If you are running all of this locally, you should expect things to draw slower when it gets out on your network or the Internet.

it might also be worth profiling the canvas right in the browsers.

Firstly amazing job on the list box scheduler. If we had more control over it I would use it. There are still issues with it though like selecting a cell highlights the entire row etc. How do you style a portion of the column like that? List boxes are definitely the fastest control for tons of info.

Secondly this whole conversation is about the suitability of the canvas. I should be able to draw the Mona Lisa with strings and circles and paint it fairly quickly. It should be a good tool but due to its speed it’s not.

Thirdly containers are an option if you reuse them. When dealing with unto 800 cells there can be huge time penalty to close them and reset them. When you initialise them the user is waiting for it to happen. You could start it in the background. If you reuse them you need an algorithm to hide unused ones and reshuffle them into the right spot. It’s doable yet messy.

I prefer the canvas because coding is simple and contained, but just need more speed.

I have tried spooling up a micro aws instance in Oregon (I am in Sydney Australia) and it does not work at all. A small instance is poor but a Sydney based instance runs fine with single digit pings. LAN is fine obviously.

Negative… take a look here:

Just styles and a bunch of routines… nothing special about this.

Well I’ve never used more than 50 at the same time but I am pretty sure, they won’t lag.

this is what I get

I have not seen where I can apply a style on a single cell other than desktop version? I think I need to go back and have another look.

They do. 800 is allot of controls no matter what it is and embedding them is time consuming. closing them and adding them is worse, obviously. The only way as mentioned above I have gotten it to work is to keep them embedded but make them invisible if not used and reshuffle them according to what needs to be shown.

Tomas Jakobs
You sir have just made my day.
I can put up with a blue line for the speed of the listbox.
I had no idea individual cells could be assigned a style.
Next time you are in Australia look me up, I owe you a beer!

Haha… but only if you pay the flight :wink:

btw. I’ve put a demo CGI with 800 randomized WebContainers in a loop just to check how slow it is.
It starts slow I guess due loading time but when it’s loaded, it works as usual and mouseclick on any control reacts normal, no lag…

http://jakobssystems.net/demo/ticketsystem.cgi

I’m sorry, but that is a completely unrealistic expectation given WE’s fundamental architecture. The more performance you need, the more processing you need to push to the browser and eliminate round trips to the server. I suspect your best bet will be to create a custom control using the Web SDK, so that the majority of the calculation and drawing is done on the client, not the server.

I have done this also and as you see its the initial load that’s the killer.
While it cannot do everything I need it to do, your listbox suggestion has solved 80% of my issues.

I get the sentiment but I don’t entirely agree. If I invalidate a canvas with a simple 8X30 grid with (essentially emulating a listbox) over the internet you experience wait times of over 60 seconds (single digit ms pings to server). Over LAN its about 40 seconds.

I understand the nature of the internet and the ordering issues etc and hence the extra delay. If I put the canvas in a container, destroy it and embed it every time I need a refresh it takes 2 seconds over the net and about 1.6 on LAN.

I have included a massive algorithm to sift through a 100 row record set and place information accordingly throughout the canvas and the worst result I get for the processing time is 200ms, paint 50ms, SQL query 50ms. That leaves 1.7 seconds for network latency and the mysterious comparo algorithm to do its thing (down from 60 seconds).

Before we can deal with “extreme painting” something on the backend needs a tweak.
At this stage of development I cant invest any time into websdk, I need to push something out. refactoring for a listbox is fairly simple.

I appreciate the websdk suggestion though. While I have used Xojo/RB for a long time, somethings manage to escape me - like individual cell formatting in a listbox!

I’m still wondering if WebListBoxTD isn’t the answer. (Assuming you’re not already set on another work around discussed here.)

Can you describe a test grid, what it should look like and be filled with? Something I could quickly code and measure. Or send a visual mock up? HTML sent to WebListBoxTD renders pretty quickly, especially with the features added in 1.3.3.

Thanks Daniel but I don’t want to go through designing an algo for creating html tables. I have settled for the listbox for now and will add other features later.

I need to rapidly switch between say a grid, a graph, a dashboard and any other display that might come up etc. Canvas would be perfect for this if it was a little faster. Desktop is fine for speed but out of the question.

The listbox lets me down by not being able to draw little coloured squares in the cell to indicate different inputs/outputs and conditions. I haven’t even bothered with images. I am down to 2 seconds on the canvas so I will just make the app look like it is gathering a vast quantity of data (something that cant happen with a grid), that may actually give the impression of an impressive amount of number crunching! At least that’s what I will tell the end user.