Archived forum. This is a read-only copy of the Smart Keyboard community forum (2010–2015), kept for its history and its skins. Posts are shown as they were written, so some answers are out of date — see Help for current information. Want a post of yours removed? Email contact@smartkeyboardpro.com.
1 single lag after start up
dbum
Hello,
using Android 2.3.3 on a Galaxy S2 I have the following problem.
- wake phone - launch sms app for example - smart keyboard opens up very quickly - start typing - LAG after the first letter - then becomes all smooth again for the rest of the typing
So it seems Android (i don't use a task killer) had killed smart keyboard and when I start typing it needs to load its stuff into the RAM again. Maybe the user dictionary since it lags exactly the moment i hit the first letter but how do I know..
Is there a way for me to fix this, or is there a way for you to fix this generally, cyril?
Thanks in advance and best regards
Daniel
cyrilDeveloper
This is something I want to improve in the next versions. CPU-consuming initialization tasks are supposed to be done asynchronously, but it seems something is still taking time when the first letter is typed indeed.
dbum
Brilliant! Thanks for answering, I am very much looking forward to this since it would complete this otherwise excellent keyboard for me.
noble
I am also a victim of this irritating lag
I have SGS2 now but lag appear also with SGS. I have found that suggestion bar is a main reason for lag. Lag appear when you press first letter and smart keyboard pro will load suggestion bar. Can you guys fix that bar will already load same time as keyboard? Or otherwise improve that? I cannot disable suggestion bar in daily use because I think it is one of the greatest feature of this keyboard.
cyrilDeveloper
Well, there is no such thing as "loading the prediction bar". However it's true that the dictionaries are loaded on demand, i.e the first time text is entered. This is done in a separate thread so it should not block the UI, but it takes CPU resources so it can indeed impact the UI thread anyway. As loading the dictionaries (especially the smart dictionary) can take several seconds, I'm not convinced that doing it as soon as the keyboard is visible will completely solve the problem, but it's worth trying. I will post a beta later so that you can try.
noble
Yeah, if you figure out what there is a problem and make a beta I can test it.
By the way I don't know what is the reason but with SGS+CM there was no lag with 1st letter. With other roms (stock and custom) there was that lag. I don't have that SGS anymore but I think SGS2 should have enough power to handle some tasks
noble
cyril wrote:Well, there is no such thing as "loading the prediction bar". However it's true that the dictionaries are loaded on demand, i.e the first time text is entered. This is done in a separate thread so it should not block the UI, but it takes CPU resources so it can indeed impact the UI thread anyway. As loading the dictionaries (especially the smart dictionary) can take several seconds, I'm not convinced that doing it as soon as the keyboard is visible will completely solve the problem, but it's worth trying. I will post a beta later so that you can try.
A correction: after testing it seems you are right. Loading the smart dictionary take several seconds and makes that lag. If I disable smart dictionary there is no lag. No lag even prediction bar is enabled.
So is there change to improve smart dictionary?
cyrilDeveloper
Yes actually I was wrong, the dictionaries are already loaded as soon as the keyboard is shown (even before actually). There is definitely room for improvement for the smart dictionary; today it's based on a standard Android sqlite database, which may not be the most efficient method. I will check if quick optimizations are possible, otherwise I will need to rewrite everything...
noble
At morning there was still lag even with smart dictionery. Now I disable all dictioneries, suggestions and quick fixes. After that it seems to be better.
cyrilDeveloper
Well, there is no magic, everything comes with a cost. Anyway in the latest beta I changed a bit the way the smart dictionary is loaded, and now only the current language is loaded when the keyboard is shown, whereas everything was loaded before. Of course it will only make a difference for people using several languages, but it's better than nothing to start with.
noble
Nice work cyril!
After quick test I don't see lag after 1st letter while dictioneries, suggestions and quick fixes are enabled. I will test it more and comment if I will find something new.
cyrilDeveloper
Do you use several languages? Otherwise it's strange that my change improved something for you
noble
I have english and finnish dictioneries but only finnish is enabled now.
cyrilDeveloper
Can you download the beta again? I just saw the smart dictionary was broken by the optimization... Now it's fixed, and the load is even twice faster, and avoids a lot of memory allocations => less garbage collection => less lags
noble
cyril wrote:Can you download the beta again? I just saw the smart dictionary was broken by the optimization... Now it's fixed, and the load is even twice faster, and avoids a lot of memory allocations => less garbage collection => less lags
OK, I done that. Feels better again!
dbum
Market update today, 4.2.0, seems to have fixed the lag for me.
cyrilDeveloper
dbum wrote:Market update today, 4.2.0, seems to have fixed the lag for me.
Maybe too soon to speak But good news anyway!
dbum
cyril wrote:
dbum wrote:Market update today, 4.2.0, seems to have fixed the lag for me.
Maybe too soon to speak
It was. Guess I didn't kill the smart keyboard correctly in order to reproduce the issue.. had a lag a minute ago. Anyway keep up the brilliant work.
noble
Yeah, found lag again...
noble
Any progress with lag problem?
cyrilDeveloper
What do you expect exactly? Lags have many different causes, I did improvements where it was possible, but it's impossible to solve lags due to high CPU usage in an app (not in the keyboard) when you start typing, which happens very often on HTC phones (even powerful ones), and even with the stock keyboard.
shouji
Hiya Cyril, I was wondering, do you know if the HTC Sensation ROM can be ported to the Galaxy S2?
cabrote
Hello, I downloaded version 4.6.3 July 2012 and First Letter Lag still happens... How can I solve this? I disabed Smart Dictionary and lag still present.