Discussion:
[LyX/2.2-staging] Do not store Languages objects in completion words lists
Jean-Marc Lasgouttes
2014-03-24 15:26:51 UTC
Permalink
commit 8ac5f09c1783261018a107b54ce398733b8f97a4
Date: Fri Mar 21 12:24:47 2014 +0100
Do not store Languages objects in completion words lists
In the current code each paragraph contains a map<Language,
WordList*>, which means that it contains a full copy of the language
object. Since these objects contain translation tables nowadays, this
is a very bad idea.
This patch simply replaces the Language key by a string.
When loading the Userguide on linux/x86_64, the total memory
consumption decreases from 36.27MB to 31.50MB.
Richard, I think we want that for 2.1.x eventually. In what branch do
you want me to commit it?

JMarc
Richard Heck
2014-03-24 15:31:51 UTC
Permalink
Post by Jean-Marc Lasgouttes
commit 8ac5f09c1783261018a107b54ce398733b8f97a4
Date: Fri Mar 21 12:24:47 2014 +0100
Do not store Languages objects in completion words lists
In the current code each paragraph contains a map<Language,
WordList*>, which means that it contains a full copy of the language
object. Since these objects contain translation tables nowadays, this
is a very bad idea.
This patch simply replaces the Language key by a string.
When loading the Userguide on linux/x86_64, the total memory
consumption decreases from 36.27MB to 31.50MB.
Richard, I think we want that for 2.1.x eventually. In what branch do
you want me to commit it?
If it's intended for 2.1.x, then it should go into 2.1.1-staging. I think.

Richard
Jean-Marc Lasgouttes
2014-03-27 13:13:22 UTC
Permalink
Post by Richard Heck
Post by Jean-Marc Lasgouttes
Richard, I think we want that for 2.1.x eventually. In what branch do
you want me to commit it?
If it's intended for 2.1.x, then it should go into 2.1.1-staging. I think.
Done.

JMarc
Jean-Marc Lasgouttes
2014-04-21 22:40:36 UTC
Permalink
The warnings that remain after this patch are of two sorts:

* unused parameters in boost, like:

In file included from
../../../../master/boost/boost/smart_ptr/make_shared_array.hpp:15:
../../../../master/boost/boost/smart_ptr/detail/make_array_helper.hpp:75:62:
warning:
unused parameter 'other' [-Wunused-parameter]
bool operator==(const make_array_helper<T[], U>& other) const {
^

* problems with hidden overloaded virtual functions. I read about it,
but I have to admit that I do not know what is the real way to shut this
warning off.

../../master/src/mathed/InsetMath.h:181:15: warning:
'lyx::InsetMath::write' hides overloaded virtual function
[-Woverloaded-virtual]
virtual void write(WriteStream & os) const;
^
../../master/src/insets/Inset.h:455:15: note: hidden overloaded virtual
function 'lyx::Inset::write' declared here: type mismatch at 1st
parameter ('std::ostream &' (aka 'basic_ostream<char, char_traits<char>
&') vs 'lyx::WriteStream &')
virtual void write(std::ostream &) const {}
^

JMarc
commit 8ac5f09c1783261018a107b54ce398733b8f97a4
Date: Fri Mar 21 12:24:47 2014 +0100
Do not store Languages objects in completion words lists
In the current code each paragraph contains a map<Language,
WordList*>, which means that it contains a full copy of the language
object. Since these objects contain translation tables nowadays, this
is a very bad idea.
This patch simply replaces the Language key by a string.
When loading the Userguide on linux/x86_64, the total memory
consumption decreases from 36.27MB to 31.50MB.
Richard Heck
2014-04-21 23:09:27 UTC
Permalink
Post by Jean-Marc Lasgouttes
In file included from
unused parameter 'other' [-Wunused-parameter]
bool operator==(const make_array_helper<T[], U>& other) const {
Not much we can do about that, is there?
Post by Jean-Marc Lasgouttes
* problems with hidden overloaded virtual functions. I read about it,
but I have to admit that I do not know what is the real way to shut
this warning off.
'lyx::InsetMath::write' hides overloaded virtual function
[-Woverloaded-virtual]
virtual void write(WriteStream & os) const;
^
../../master/src/insets/Inset.h:455:15: note: hidden overloaded
virtual function 'lyx::Inset::write' declared here: type mismatch at
1st parameter ('std::ostream &' (aka 'basic_ostream<char,
char_traits<char> > &') vs 'lyx::WriteStream &')
virtual void write(std::ostream &) const {}
^
This looks a bit worrying, as if it invites confusion between these
functions. Can we rename one of them\?

Richard

Loading...