Page 1 of 1

How to use plaintext?

Posted: Tue May 02, 2017 7:18 am
by Pacerier
The styling is causing Cintanotes to run slowly. Is there any way I can use fast plaintext mode for the notes?

Re: How to use plaintext?

Posted: Wed May 03, 2017 10:02 am
by CintaNotes Developer
What actions exactly are slow?
Why did you decide that styling is the cause of the slowdown?

Thanks

Re: How to use plaintext?

Posted: Thu May 04, 2017 11:43 am
by Pacerier
1. Sometimes I double-click to open a long note.

The opened window lags and blinks and blinks and blinks. Should be due to it trying to display {italic, bold, link} styles for the words and links.

2. Sometimes I double-click to open a long note and start typing.

The opened window lags and blinks and blinks and blinks and what I typed gets displayed really slowly. Should be due to it trying to display {italic, bold, link} styles for the words and links. Sometimes it even crashed here with "cintanotes not responding".

Re: How to use plaintext?

Posted: Thu May 04, 2017 12:22 pm
by CintaNotes Developer
I need an example of such a note.

This is not a performance issue, this is most probably a bug that causes code to cycle and eventually overflows stack.
Can you find such a note and send it to me in XML format?
Thanks!

Re: How to use plaintext?

Posted: Thu May 04, 2017 2:07 pm
by Pacerier
The opened window lags and blinks and blinks and blinks and finally appears without errors, after somewhere between ~1 to ~10 seconds.

This must be a performance issue isn't it? It's the same for every long note I have.

Re: How to use plaintext?

Posted: Thu May 04, 2017 3:35 pm
by date
CintaNotes Developer wrote:I need an example of such a note.
Go to images.google.com and search for an image. When the focus is on the page press the End key 4 times, and click 'show more.' Then press the End key a few more times, about 5 or 6. Then press Ctrl-A, and the clipping key. (The retain HTML formatting must be enabled of course.) Then open that note.

Re: How to use plaintext?

Posted: Thu May 04, 2017 7:43 pm
by CintaNotes Developer
Thanks date!

Yes, I was able to reproduce and fix the issue.
Please try this version: http://cintanotes.com/files/beta/CintaN ... _Beta1.zip

Re: How to use plaintext?

Posted: Fri May 05, 2017 9:35 am
by date
Appears much faster! It didn't occur to me this was a performance issue or something fixeable. But 'up to 10 seconds'... I wonder how long those notes must be...

Re: How to use plaintext?

Posted: Fri May 05, 2017 11:12 am
by date
I managed to have a lag of more than a minute (I didn't sit it out) by clipping this whole page: https://en.wikipedia.org/wiki/List_of_A ... n_treaties . About 1 mb of text with links and formatting.
In this version: 2 seconds delay before opening, when opened it doesn't lag, when closing the note there is a 10 second lag. And it appeared as if search is a bit slower. Deleting the note took 5 seconds.
So there definitely is some great performance improvement here. I can imagine things aren't going to be instant when you have multiple of such 1 MB notes though.

Re: How to use plaintext?

Posted: Mon May 08, 2017 10:58 am
by CintaNotes Developer
Thanks, date!
There's still room for improvement there. However it will require much more effort. For the usual data I think the current version is good enough :)

The slower search speed is weird, are you able to prove it? Seems I've touched nothing that could have affected search speed.

Re: How to use plaintext?

Posted: Tue May 09, 2017 6:41 pm
by date
The slower search speed is weird, are you able to prove it? Seems I've touched nothing that could have affected search speed.
Why weird? It is not something that changed recently. Search is instant on 10.000 notes averaging 1 kb, but very slow on a few large notes, like one or two of those 900 kb wikipedia articles. It does not matter if those two 900 kb notes are added to the 10.000 or if they are in a separate section. I can probably prove it but it seems obvious to me?

Re: How to use plaintext?

Posted: Tue May 09, 2017 8:11 pm
by date
It takes roughly about 200 ms to search on the largest wikipedia article. On the 2 largest, 400 ms. It doesn't matter if they are in an existing large notebook or in an empty one, those 200 ms each just get added to the established notebook search speed. That doesn't seem much but on two of my notebooks with thousands of notes it takes about 100 ms for each search.


The time it takes to lift one finger and press the next key averages 150 ms. The time it takes for your eyes to register the next image is obviously much lower so if the expected image doesn't catch up with your typing speed I definitely consider it 'noticeable.'


Ahk script for measuring search speed here. Not neccesarily highly accurate but there is no doubt that with one very large note search takes twice as long.

Code: Select all

;get the letter 'e' on the clipboard, run this and paste it in CN search with ctrl-v. then clip one or two of the largest wikipedia articles and try again.

^V::
IfWinActive, ahk_class CintaNotes.MainFrame
{
ControlGetText, out, Cinta.Label1
ControlGetText, out2, Cinta.Label1
ttime = % A_TickCount
sendinput ^V

while out =out2{
   controlgettext, out2, cinta.label1   
    continue
   }
msgbox % A_TickCount-ttime
}

Re: How to use plaintext?

Posted: Wed May 10, 2017 7:14 am
by CintaNotes Developer
I meant that the search speed per se shouldn't have changed recently.
Of course it is depentant of the kind of notes you have.

Thanks for the script, it'll come in handy. BTW did you notice of there's any change of speed regarding if the large note stays in the "found" list, compared when it goes out of it (i.e. doesn't contain the search phrase anymore)?
Also it would be useful to limit the search scope to 'text only' to make sure that it's text matching that is slow.

Re: How to use plaintext?

Posted: Wed May 10, 2017 5:50 pm
by date
CintaNotes Developer wrote:BTW did you notice of there's any change of speed regarding if the large note stays in the "found" list, compared when it goes out of it (i.e. doesn't contain the search phrase anymore)?
Also it would be useful to limit the search scope to 'text only' to make sure that it's text matching that is slow.
On the right bottom inside a found note is a square box that displays how many times the phrase searched on occurs in the note, like 1/xx. (Somehow always stays 1 on the left side of the slash?) Somehow it looks like that is the bottleneck, at least for a good part.

When you sort the list in such a way that when your search matches a good number of notes including the very large one, but the large one is further down and not loaded in the 'view' it doesn't seem to impact search performance in terms of speed all too much or at least much less.

Re: How to use plaintext?

Posted: Fri May 12, 2017 6:05 am
by CintaNotes Developer
Interesting. Actually CN counts the number of matches already after the notes list is fetched, without the help of the database (FTS doesn't return number of matches anyway). I can easily imagine this to be slow if the note size is very large.

Re: How to use plaintext?

Posted: Fri May 12, 2017 6:06 am
by CintaNotes Developer
BTW regarding the first number - for it to increase, focus the note and press F3/shift+F3 to jump between matches.