Life after Calc core change

Embed Size (px)

Citation preview

1. Life after Calc CoreChangeKohei Yoshida 2. Topics What change was made in Calc core. Affected areas. Expectation vs reality. Going forward. 3. What change was made in Calc core.https://libreoffice-from-collabora.com 4. ScDocumentOld modelScTableScColumnScValueCellScBaseCellBroadcaster (8 bytes)ScFormulaCellText width (2 bytes)Cell type (1 byte)Script type (1 byte)ScStringCell ScEditCellScNoteCell* 5. New modelScDocumentScTablemdds::multi_type_vectorsvl::SharedString blockdouble blockEditTextObject blockScFormulaCell blockScColumnBroadcasterText widthScript typeCell value 6. Iterating over cells (old way) 7. Iterating over cells (new way) 8. Before shared formulaScFormulaCell ScTokenArrayScFormulaCell ScTokenArrayScFormulaCell ScTokenArrayScFormulaCell ScTokenArrayScFormulaCell ScTokenArrayScFormulaCell ScTokenArrayScFormulaCell ScTokenArray 9. After shared formulaScFormulaCellScTokenArrayScFormulaCellScFormulaCellScFormulaCellScFormulaCellScFormulaCellScFormulaCellScFormulaCellGroup 10. Shared string conceptsvl::SharedStringPoolsvl::SharedStringOriginal string poolUpcased string poolsvl::SharedStringsvl::SharedString 11. String comparison (old way) 12. String comparison (new way) 13. Bottom line... Largest refactoring effort in Calc code. Most critical parts of Calc code havechanged. Shared formula - ScFormulaCell nolonger owns ScTokenArray at all times. Shared string - all string objects need tobe pooled. Random access to cell array is no longerO(1). 14. Affected areashttps://libreoffice-from-collabora.com 15. Calc95 %Non-scientific estimateAffected by core change 16. What features are affected?Undo / RedoFormula Dependency Reference Updates Copy & PasteSorting ODS Import / ExportExcel Import / Export Named RangeContent RenderingFind & ReplaceCell CommentCell EditingDatabase RangeLive SpellcheckVBA API LayerUNO API LayerSYLK Import / ExportDBF Import / ExportCppUnit TestRTF Import Quattro Pro ImportHTML Import / ExportExternal ReferenceDIF Import / ExportChange TrackingCSV Import / ExportConditional FormattingChart Data ProviderCell ValidationFormula CalculationFormula Tokenization Case ConversionAutofilter ... 17. Expectation vs Realityhttps://libreoffice-from-collabora.com 18. Check #120 to 50% of the code changewould cause regressions.Almost all code changes causedregressions in some form. Some didmore than others. 19. Check #2The worst part is behind us. We justneed to fix trivial bugs.The worst part was yet to come.Lots of medium-to-large follow-uprefactoring ensued. 20. Check #3Just focus on regressions duringthe 4.2 releases, and go back tonormal for the 4.3.We did fix the worst ones in the 4.2cycle. But many still remain. 21. Check #4We already wrote a lot of unit testsfor Calc core prior to the change.They should keep us safe.We ended up doubling the amountof unit tests for Calc during the 4.2period. We still dont have enough. 22. Check #5As a responsible coder, I will fix allthe bugs my change caused.Calcs core is too large for onecoder to handle. We need multiplepeople who can handle bugs inCalc core. 23. Going forwardhttps://libreoffice-from-collabora.com 24. Challenges we face Squash remainder of regressions causedby the core change. The number still toohigh. Gather more people becomingcomfortable handling bug fixes in Calccore. Build the culture of writing unit test foreach and every bug fix. 25. Unit test is key One unit test is worth 20 future bugfixes. A bug fix does not finish until youwrite a test. Writing unit test is courtesy for yourfellow developers. We really dont have a choice. 26. Unit test is key (repeated) A bug fix without a unit test WILL GETBROKEN AGAIN in the next release. A bug fix with a unit test WILLREMAIN FIXED FOREVER.Which one will beyour choice? 27. THANKS!https://libreoffice-from-collabora.com