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.
Performance of TRVMathItemInfo
Re: Performance of TRVMathItemInfo
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)
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)
Last edited by Vitalii on Wed May 08, 2019 4:47 pm, edited 1 time in total.
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Performance of TRVMathItemInfo
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.
I made the changes, they will be included in the next update.
Re: Performance of TRVMathItemInfo
Thanks, great!