GWT: does code-splitting have any effect when in development mode - gwt

I've read in so many places that code-splitting can significantly speed up the initial loading time of a GWT application.
However, before we do the splitting, we would like to know whether the deferred download of codes also work when in development mode?
Currently our most painful point is that in development mode with debug mode, when we refresh the browser (to refresh the changes in client code) it will take 3.7 years for the app to reload.
In production mode the application will load in a matter of seconds.

Code splitting has absolutely no effect in Dev Mode, because your application is not compiled to JavaScript.
When GWT.isScript() is false (Dev Mode) RunAsyncCallback.onSuccess() method is run immediately. It is apparent if you inspect the source code of the GWT.runAsync() method.
EDIT: just a small thing to add as well: do NOT use Chrome with DevMode. Chrome still has an outstanding bug (the link escapes me right now) that makes the DevMode Plugin for Chrome run really slowly. Use Firefox, it is the fastest with the Dev Mode plugin.

As said before code splitting has absolutely no effect in Dev Mode.
Only thing that I could suggest you is to increase memory for jvm on start:
For example we use in our project:
-Xmx1024m -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:PermSize=256M -XX:MaxPermSize=512M
Also upgrade your working hardware(CPU, memory), it's could help you to compile faster your java code on Dev mode.

If you want faster DevMode you should be more careful with how you write your application. User lazy loading where possible, split app into standalone modules.
E.g. let's say you have some app with 5000 classes. And usually a developer needs to change only some part of application, not all application (one page for example). So basically you need to make sure that to start one simple part of app, only classes needed by the app are loaded. E.g. instead of loading 5000 classes only 100 will be loaded. Also check for common errors like RPC Type Explosion, they affect devmode as well. And try GWT 2.4 it is much faster than previous versions (I mean DevMode).

In my (medium length) experience I noticed Internet Explorer 9 is also pretty fast in Dev Mode, and a lot more stable than Chrome. The GWT plug-in doesn't crash every other reload of the application.
You could give it a try, see if it works better for you.

Related

Setting breakpoints and hitting the first breakpoint is now very slow in vscode when debugging a React app

That used to work much better a couple days ago, but now, when I want to debug my CRA webapp in Chrome, I have big delays (10 - 20 seconds) when setting or hitting breakpoints. Right now I even got a message from vscode
saying that
It's taking a while to configure your breakpoints. You can speed this up by updating the 'outFiles' in your launch.json".
The thing is: I don't have out files when debugging a react application.
What do I have to set there instead? Side note: I'm using the built-in Chrome debugger support instead of the deprecated Chrome extension.
there is this github discussion about this problem, you can go check further, but a quick trick is to add this in your configuration.
{
...
"outFiles": [],
"resolveSourceMapLocations": null,
},
It turned out that including the Typescript source maps in the production build caused the long delays. These files are very large (larger than the actual code) and hence require pretty long to be loaded.
In my project I enabled source maps as part of the Babel builds. This way I can debug Typescript code in a Visual Studio Code Web view.

GWT Super Dev Mode Incremental Compilation doesnt work

I use gwt 2.6.1. I've would like to use Super Dev Mode.
I normally run with RMB on project, then I select Run Super Dev Mode.
My app is huge, so it takes time to compile, and finally when it is done I am making small change in gwt client code, I refresh web page, and nothing happend. Application have same view/behavior like before this change.
Only stopping Super Dev Mode and starting it again makes changes visible, but it takes so much time (cause it recompile from scratch).
Please help me, how can I use incremental compillation in gwt.
I've already added:
<add-linker name="xsiframe"/>
to my *.gwt.xml file.
please help.

Xcode: compiled application file does not work as in debug runtime

I have an issue where when I run my application in debug mode, the application shows obvious runtime lags. As specified in numerous articles, the application bundle will run up to 10X faster than when running from xcode (including with instruments).
However, when I open the app (going through the project explorer/products/app_name.app) and show in finder then run the app, several features that work perfectly in debug mode (in my case, certain keyboard press functions).
The app runs much faster as expected than the debug mode runtime, but lacks some of the behaviors which work in debug mode. Furthermore, some other actions close the application altogether.
I don't know where to start figuring this out but have some intuition and would like confirmation what it might be:
1-Instruments: is there a difference of memory usage between debug and application bundle for which debug keeps a cap on memory usage, CPU usage etc?
2- COnsidering cache misses, is it possible that my nSResponder when I activate a key does not catch some later down the track switch cases, which will create a cache miss? (I doubt this since my controls file runs as an extension to one of my main loops). Note: If this works fine in debug mode, why would it not work in the application itself?
Any pointer to why this behavior greatly appreciated, so that I don't make large changes that won't affect the outcome (It's a large project).
So are you saying that when you compile for debugging (-ONone), then things work. But when you compile for release then some things don't work?
Try unchecking 'Enable backtrace recording' in the Options tab of the Run scheme action.

How do I get the full compile log in Activator?

I have a large (> 25k) app that I've been developing in Scala/Akka/Play for a couple of years now. I'm in the process of upgrading it to the current version of the world (everything was a major version or two behind), which means getting it running in Activator. I'm gradually wrestling my way through that, but I'm somewhat stymied by the fact that Activator's "compile" window is very short -- only a few screens long -- so most of my 50-some-odd remaining compile errors are scrolling off the top. I'd really like to be able to read the entire thing, since I assume that most of these are knock-on errors, and only a few are really significant.
Where does the actual compile log go? How can I get to the whole thing?
It sounds like you're trying to use the UI mode when you were happy with the command line mode in Play 2.2; the command line mode is still there, see http://typesafe.com/blog/typesafe-activator---an-update-and-roadmap-preview for some background. Just run "activator" instead of "activator ui". The UI mode is not something that's "production hardened" yet, it is primarily intended for tutorials (though we are working to change that).
That said the compile log should not be truncated in the UI and we appreciate bug reports at https://github.com/typesafehub/activator/issues including one about this truncation.

GWT development with Eclipse

I am developing a GWT app using eclipse and I was wondering if there is a way to hot swap client code changes I make without having to do a full Google Compile each time. Currently when I modify my code, I do a Google compile and then click the Reload server button, then I refresh my browser to pick up the changes. This is starting to get a bit painful as it takes 10 - 20 sec to do a full compile when I may have only modified a UI string so was wondered is there a quicker way.
If you want to see your changes in client code, hit the refresh button in your browser.
If you need debug functions, use Debug As => Web Application. It may be a little (or a lot) slower to start depending on a browser.
If you don't need debug functionality, use Run As => Web Application. It starts faster. You will still see all errors in Development Mode and Console tabs.
If you make changes to server-side code, you have to reload the web server, using the dedicated button of the dedicated Development Mode view in Eclipse.
You never need to recompile unless the plugin tells you to do it.
See https://developers.google.com/web-toolkit/doc/latest/DevGuideCompilingAndDebugging#DevGuideDevMode
To add to Andrei's answer Assuming we are changing functionality invoked on button click.
1) We usually change lines of code in the function invoked and click the button again in the UI. No need of reloaing the entire application using refresh button.
2) If the change involves code that cannot be hotswapped - example class changes like adding new a class variable, then you need to refresh browser. You can sometimes ignore the eclipse warning complaining that it cannot hot-swap.
3) If you run out of memory then you need to close and relaunch dev mode.
4) If your server side is hogging memory then it might be better idea to use external server rather than jetty to avoid time consumed on server restart for every dev mode launch.