Main Menu

Resource usage...

Started by iggi, October 22, 2008, 11:41:30 AM

Previous topic - Next topic

iggi

Hi,

   I don't know if this is considered a bug, but the ratio of application memory usage/file size
seems to be really high...
For example, I opened plain text file, 30MB in size without performing any operation on it and
memory usage went from 10MB to 100MB.

I've tested this with some other editors (plain text file, cca. 30MB):

- Notepad and WordPad use around 20% less memory
- UltraEdit around 80% less memory
- Notepad++ 90% less memory...

It seems that HippoEdit has the highest memory usage, so I was wondering if there's a way to reduce that to some lower values...?

alex

#1
Hello iggi,

for now HippoEDIT load complete file into memory (as Notepad, WordPad, Notepad++, PSPad etc).
Because it is Unicode (as Notepad and WordPad), and probably your file is ASCII, the memory consumtion is twice more. ASCII uses 1 byte for character, Unicode 2 bytes. So 30*2 = 60 Mb.
In addition HippoEDIT does so called statistics harversting. It collects all words used in document with rates of occurences and position in text to suggest them when you type. So depending of the frequency of the words you can have 60 megs more if you work with log file for example... For source code it usually less.
In addition there are line information, gap buffers for strings (occupied size for a line usually a little bit more) and some other buffers.

So at the end you really can get 100 megs.
But this is a compromise between functionality + speed and memory consumtion.
Because nowadays memory is cheap, and mostly there are no problems with it, in HippoEDIT I prefer to be faster/do more in advance then try to spare memory. But of course this does not mean that I am not checking that ;)

Thanks a lot for your interest ;)

Best regards,
Alex.

P.S: You can try Me/98 version, it is not Unicode and should consume 2 times less resources.
Also I thought a little bit about statistics collection... I think it would make sense to disable it for files bigger then something (for example 5 megs), so you would get 20 % less probably.. Thanks for idea ;)
And about Notepad++. 90% means 10 Megs  for 30 Megs file???

HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

iggi

Thanks for replying and explaining!

Like I said, I was not sure if this should go under bugs or under feature requests :)
Anyway, I agree with this
QuoteBut this is a compromise between functionality + speed and memory consumtion.
and I must admit that it really has a better performance comparing to editors I mentioned.
However, I still think that it would be a nice feature if you could choose between speed and memory.

P.S. I tested 98/Me version and it does use two times less resources.

QuoteAnd about Notepad++. 90% means 10 Megs  for 30 Megs file???
Yes, but its performance was awful compared to HippoEDIT...

alex

I have tried optimization I mentioned - dont calculate statistics for files more then 2 megs (size of file can be adjusted in settings.xml file).
It is very rear case when you have source code file bigger then 2 megs.

My results were approx 24 megs for 10 meg file. That is from my point of view ok. Because it could not be less then 10*2 because of the unicode.
The optimization would be available in 1.40 beta I would upload today.

QuoteHowever, I still think that it would be a nice feature if you could choose between speed and memory.
I can try to optimize buffers size, dependently on available memory or user settings... I would think ;)

QuoteYes, but its performance was awful compared to HippoEDIT...
No, Notepad++ is not so bad ;) It should be faster (editor at least) because it use hardcoded parsers and HippoEDIT dynamic one. And also text engine it uses (scintilla) is really powerful. But from this text engine also come limitations. It is not owned by Notepad++, so it depends on it. It is multi platform, so it could not use some windows specific functionality etc.
But i still have doubts that for dispalying 30 meg file, Notepad ++ uses 10 megs. I have checked it with 40 meg file and get 96 meg memory consumtion... To consume  less memory then file size you need to use memory mapped files and load file on demand (this rather complicated from technical point of view) as disk editors do, or just swap memory to hard drive, but I dont see sence in this... Maybe there are some settings controling that?
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

iggi

 :) Oh, no, I didn't say that N++ is bad, but just that it performed slower when I
was testing same text operations in both editors.
And yes, I was obviously watching resource usage of some other process ::), because now I
get for 41MB file, 51MB usage (whereas HippoEDIT 98/Me uses around 78MB).
Anyway, concerning the speed I really can't say anything, because this is probably one of
the fastest editors I have ever tried with such functionalities.