Page 1 of 1

Performance of TRVMathItemInfo

Posted: Sat Jan 26, 2019 10:33 am
by Vitalii
Good day!
I noticed that TRVMathItemInfo is significantly slower than the other items. I understand that this is an "external" class and speed depends on rendering algorithm, but loading 100 formulas from a file or stream takes about 20 seconds (in TRichViewEdit). I am developing an application for the scientific field, where the number of formulas can reach hundreds and equations change very often. Is there any solution to increase the speed of work with this class?
Thanks)

Upd. Load operations themselves are fast, but the Format function delays the process.

Re: Performance of TRVMathItemInfo

Posted: Thu Jan 31, 2019 10:19 pm
by Vitalii
I think I understand what's the matter.

A function GetMathFontName in unit RVMathItem performed on every update of item (recreates font list with TMathTable.EnumMathFonts). Experimentally, I comment this code and try to work with single instance of font list (in initialization / finalization sections). Perhaps I did not take something into account, but this solution works perfect — speed of TRVMathItemInfo increased at times!

Can I recommend this solution to developers? Thanks)

Re: Performance of TRVMathItemInfo

Posted: Thu Feb 28, 2019 2:27 pm
by Sergey Tkachenko
You are right, the list of font names should be made global. Currently, a list of fonts is stored only if TRVMathDocObject is added to TRichView.DocObjects.

I made the changes, they will be included in the next update.

Re: Performance of TRVMathItemInfo

Posted: Wed May 01, 2019 6:57 am
by Vitalii
Thanks, great!