B4J Question app work speed in DEBUG mode

peacemaker

Expert
Licensed User
Longtime User
HI, All

One my B4J crossplatform project is getting larger and larger.
Many B4Xpages that to be optionally opened by an user...
And the main is that several COM-ports must be processed as fast as possible: data flow of 115 kbaud to be received, checked, parsed, saved into the DB and drawn on the charts practically at real time scale.

Work speed question came very hard.

Firstly i changed SQLite DB to the in-memory one (instead of file), it helped a lot.
And in Release compilation - all works OK. But it was always and it is now almost impossible to debug the app - it's VERY slow work in debug-mode.
And it is going to be slower and slower further, during project is growing.

I understand that in DEBUG mode many debug lines are added into the source code by the IDE - and maybe this is the root of my trouble.

1) Any suggestion how to resolve the situation ?
2) Maybe is it possible to setup some modules by some directive to be ... not in DEBUG mode ? Say, if a module has directive like #AlwaysReleaseMode and compiled without DEBUG lines - it should work faster... @Erel, what do you think ?
 
Last edited:

MichalK73

Well-Known Member
Licensed User
Longtime User
I think it may be worth making a project version for DEBUG mode without modules that are, for example, permanent, proven, working and not needed to test other important elements. Then add these corrected modules to the production version. The question immediately arises whether this can't be done using the GIT version?
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Most fast modules are main and needed always (data flow fastest parsing) for work. And not needed to be debugged now for debugging next functions
 
Upvote 0

MichalK73

Well-Known Member
Licensed User
Longtime User
2) Maybe is it possible to setup some modules by some directive to be ... not in DEBUG mode ? Say, if a module has directive like #AlwaysReleaseMode and compiled without DEBUG lines - it should work faster... @Erel, what do you think ?
Maybe right.
What is the difference in program speed in debug and release mode?
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
difference in program speed in debug and release mode
As usual it looks like a couple of orders of magnitude faster, i mean 100 times maybe faster.
Debug needs to wait for 15-20 seconds to a next break point, but in release, this point is called tens-hundred times per second...
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
It's only one such app i have, with the need to process the data flow as fast as possible. I mean, any other "regular" apps were never so slow in debug mode.
And sure, interface freezing is also absolutely unacceptable.

It can be described like the multichannel oscilloscope when 1-10 data flows are to be got\saved\shown as an online chart on the max speed. And without freezing.
 
Last edited:
Upvote 0
Top