Why does Qt Webassembly app start too long? - qt

I am checking the examples (QtQuickControls 2.0) with QT Webassembly (6.3), and it takes too long to load the app in webbrowser over LAN, especially on smartphones compared to the laptop.
Too slow is around 40 seconds.
Most of the time as I can see on the screen it is "Compiling".
What is "compiling" in this case? I thought webassembly code is already compiled and just needs to be run.
Is QT Webassembly app always slow like this? Is there any means to make it load faster? At least load for the first time, then run it from cache, as now it spends the same much time to reload the app if page is refreshed.
I have checked the Felgo demo apps (I hope they are pretty much polished), but on my smartphone it takes around 20-30 seconds to load for the heavy example.
https://felgo.com/try-wasm/

The "Compiling" in this case refers to the WebAssembly.compile() that the qtloader.js internally calls. This basically loads the WASM binary code into the web page.
According to the comments in qtloader.js default template, the "Compiling" is displayed when a fallback is used. Normally it should say "Downloading/Compiling" which is the faster method.
return WebAssembly.compileStreaming(response).catch(function(error) {
// compileStreaming may/will fail if the server does not set the correct
// mime type (application/wasm) for the wasm file. Fall back to fetch,
// then compile in this case.
return fetchThenCompileWasm(response);
});
So check if the mime type is set correctly as the comment suggests.
The second option to improve performance is to enable gzip compression in your web server settings. The WASM files compress quite well, in my test for example a 13 MB file was compressed to 5 MB. This will make the otherwise quite large download a bit faster.
But even after all the optimizations, the Qt for WASM must still download and load a full Qt GUI framework and this will take time. On my Android phone, a smaller WASM GUI will load in about 3 to 4 seconds on local network but this very much depends how powerful the device is (I tested with CDP Browser WASM GUI which is basically a QTreeView showing some data).

Related

Does it matter if my website has build errors?

I am a C# winforms programmer, not used to ASP.Net.
As a winforms programmer I build regularly to detect syntax errors.
Recently I opened a Kentico website in Visual Studio and to my surprise found that there were build errors.
Does this matter?
My instinct is to go about correcting the site until it builds. This is a side track from what I set out to do.
If you are attempting to build any kind of quality into your project/software, then yes, it does matter if it builds.
Regarding Kentico and build times, if you're using a website vs. a web project, yes the build times are typically longer and range anywhere from a few minutes to I've seen upwards of an hour. The build times depend greatly on the machine building it as well. So if your machine has a Celeron processor, with 1GB of RAM and a 5400 RPM drive, you're going to take longer to build than a machine with an i7 processor, 16GB of RAM and a solid state hard drive that can read/write 500+ MB/s. Also keep in mind Kentico out of the box has over 9000 system files in it so as a website, it will take some time to build.
One of the first things I check when a site doesn't build is to ensure all the referenced DLLs are in the website/project. If not, this will cause several errors and is usually a very simple fix. If you have any kind of errors from code which resides in the /App_Code directory, your site will NOT run at all when you publish it. If you have errors within any other directory, the site will run BUT wherever those code files are referenced on the website, will display errors. So in your instance if you have webpart files in the /CMSWebparts/OurCompany folder, if those webparts are placed on pages within the website, those pages will error out even though the rest of the site is running.
In my opinion, just fix the errors and be done with them. Then check the code into a version control system to keep track of the changes.
Does this matter?
It depends on what you are trying to achieve with your website. If you want to make it available to the public then building is definitely something you should consider as top priority. If on the other hand you want to have the source code open in Visual Studio on your local machine, just for reading purposes, then building is not necessary.

ASP.NET 5: Huge response time in empty project

I installed latest ASP.NET 5 beta 8 and created simple project. After running my application I noticed that my app loading is too slow. I opened debugging tools in Chrome browser and found that all requests to controllers and even requests too smallest static file takes way to long. All request has TTFB over 1 second!!!!
I tried to load single file in new tab (to avoid parallel loading issues) using url to file http://localhost:57111/lib/bootstrap-touch-carousel/dist/css/bootstrap-touch-carousel.css. That is about 1 kilbyte of size. And even this single file loads about second.
I tried using IIS and Kestrel as a server, tried Debug and Release modes - nothing changed.
Other my web application (for example build on Meteor platform) works perfectly on an port with TTFB about 5-10ms
PS: server and client browser are all on the same computer
PPS: I'm on Windows 10
That's the problem with the default project in the new ASP.NET vNext?
Maybe the problem is caused by browser link, see Browserlink make website slow. 1000ms is added for secondary requests

How to get Flex app to load quicker?

We've got an app written in Flex that displays data from our app. The .swf file is only 427kb, but it takes a full five seconds to load in Firefox. This is a headache for our users because they need to access the page that contains the app frequently. (The app displays documents, and it's really slow to march through a list of them).
I've confirmed that it's not a slow web server problem. The .swf appears to be cached in the browser. Firebug reports that every time the web page accesses the .swf, the app server returns a "304 Not Modified" response, meaning that the load time from the server is almost zero.
Is there anything we can do to debug this issue? Or is the Flash player just slow?
If you're having issues with the time to download the SWF or to initialize the application, you could try breaking it up into modules and using the SWFLoader to only load the pieces as you need them. Flex applications are 2-frame movies, so the more you have in your application the more there is to initialize before it can start "playing."
If it's slow rendering everything, take a look at the creationPolicy and see if you're needlessly creating a hierarchy of items that aren't being displayed. Repeaters are also notorious for rendering slowly.
If your performance problems are more in-application, then you could consider profiling your application to see where the hotspots are.
Have you tried running the app using the Flex Profiler? That may help you isolate any performance issues.
Consider checking out the Flex RSLs. These runtime shared libraries allow the Flash Player to cache the Flex framework and after the first load allow for a much faster startup time.
Look at the
creationPolicy documentation.. it may help..
The default should be "auto"... Creates all controls only in the initial view of the navigator container. This setting causes a faster startup time for the application, but results in slower response time for user navigation.
This setting is the default for multiple-view containers.
See if someone has changed your setting.

After working for years, videos in my Flex Application won't play, just "buffering"

An application I wrote for a client almost 2 years ago using Flex 2 has stopped playing the .flv videos. It's been nearly 9 months since I've had to perform any updates to the app, so I don't have the source code on the computer I'm using at the moment. I'm not sure how often the client uses the application, so I can't say exactly when this started.
The videos just displays a black screen, does not load the first frame. I believe I used standard VideoDisplay object. The videos are contained in a folder on the same shared account as the application.
I've checked the application in latest versions of IE, Firefox and Chrome (running Flash 10) and I've also fired up a virtual machine to test it out in IE 7 with various releases of Flash 9 instead of Flash 10.
I checked, and the videos are still present, and I scattered some extra no-security cross-domain files around... but to no avail.
Does anyone have an ideas as to where I should start looking when I get back to my development computer? Could a change on the hosted server cause this?
UPDATE: I remembered another application with video that I had on the site that was made more recently using Flex 2. This application is a simple shell VideoDisplay object that serves up a .flv file in the same directory... and it works just fine.
So, the server is serving .flv files. The application I'm having problems with pulls .flv files from a different folder that is at the same level of the applications parent folder (the only difference I can see right now).
The someone cryptic error message received when using the debugging version of the Flash player was:
Error: 1000: No bitrate match
at mx.controls.videoClasses::VideoPlayer/play()
After getting back to my development machine I was able to determine that the XML file containing the URLs of the videos showed an old variant of the domain name that was in use a couple of years ago. This domain name was just allowed to expire, and so, the video player was pointing to .flv filenames no longer existed. Correcting the domain name resolved the problem.
You said the videos are still present, but are the being served?
A small hosting configuration change might cause files to no longer be served.
I would start there, you rule out that both your swf, and flv are accessible by the client browsers..
If it's on a new server, make sure it's serving the right mime type for .flv files, video/x-flv. I've had flash refuse to play videos without that set. Also, IIS now gives bogus 404 errors on requests to files of unknown mime type, so files can be on the servers, but invisible to clients. http://it.toolbox.com/blogs/rymoore/adding-flv-mime-type-in-iis-4198

Is it possible with AIR to play a video while it is downloaded

The idea is download a video in parts (from different servers) but starting to play before video file is complete.
The issue is that VideoDisplay component doesn't read the video file if it is opened for writing and vice-versa: writing is impossible if VideoDisplay plays the video...
I know I may sound totally off-topic, but you should make sure you've properly considered video streaming thru Flash Media Server, Wowza or Red5 before you put that much effort in downloading a file in chunks. Just a thought..
What about having multiple parts of the video, so playing can begin as soon as first part gets downloaded. So the parts have to be concatenated somehow at client side.
(Additionally, if one's connection is insufficient, showing a loading symbol is fine.)
Open the file in Shared mode, if that is possible with Air. Mainstream OS's (Windows, Linux, MacOS) have this functionality built in.
Use two threads:
In thread 1 (the downloader thread) open the file in Shared mode to allow reading from other threads and processes.
In thread 2 (the player thread) open the file in Shared mode to allow reading and writing from other threads and processes.
Be sure to buffer the beginning of the file so your player will always have something to play and won't choke while playing an incomplete file.

Resources