Life after Calc Core Change Kohei Yoshida - - PowerPoint PPT Presentation

life after calc core change
SMART_READER_LITE
LIVE PREVIEW

Life after Calc Core Change Kohei Yoshida - - PowerPoint PPT Presentation

Life after Calc Core Change Kohei Yoshida <kohei.yoshida@collabora.com> T opics What change was made in Calc core. Affected areas. Expectation vs reality. Going forward. What change was made in Calc core.


slide-1
SLIDE 1

Life after Calc Core Change

Kohei Yoshida <kohei.yoshida@collabora.com>

slide-2
SLIDE 2

T

  • pics
  • What change was made in Calc core.
  • Affected areas.
  • Expectation vs reality.
  • Going forward.
slide-3
SLIDE 3

https://libreoffjce-from-collabora.com

What change was made in Calc core.

slide-4
SLIDE 4

ScDocument ScTable ScValueCell ScStringCell ScEditCell ScFormulaCell ScNoteCell* ScColumn ScBaseCell

Script type (1 byte) Text width (2 bytes) Broadcaster (8 bytes) Cell type (1 byte)

Old model

slide-5
SLIDE 5

New model

ScDocument ScTable svl::SharedString block double block EditTextObject block ScFormulaCell block ScColumn Broadcaster Text width Script type Cell value

mdds::multi_type_vector

slide-6
SLIDE 6

Iterating over cells (old way)

slide-7
SLIDE 7

Iterating over cells (new way)

slide-8
SLIDE 8

Before shared formula

ScFormulaCell ScTokenArray ScFormulaCell ScTokenArray ScFormulaCell ScTokenArray ScFormulaCell ScTokenArray ScFormulaCell ScTokenArray ScFormulaCell ScTokenArray ScFormulaCell ScTokenArray

slide-9
SLIDE 9

After shared formula

ScFormulaCell ScTokenArray ScFormulaCell ScFormulaCell ScFormulaCell ScFormulaCell ScFormulaCell ScFormulaCell ScFormulaCellGroup

slide-10
SLIDE 10

Shared string concept

svl::SharedStringPool svl::SharedString Original string pool Upcased string pool svl::SharedString svl::SharedString

slide-11
SLIDE 11

String comparison (old way)

slide-12
SLIDE 12

String comparison (new way)

slide-13
SLIDE 13

Bottom line...

  • Largest refactoring efgort in Calc code.
  • Most critical parts of Calc code have

changed.

  • Shared formula - ScFormulaCell no

longer owns ScT

  • kenArray at all times.
  • Shared string - all string objects need to

be pooled.

  • Random access to cell array is no longer

O(1).

slide-14
SLIDE 14

https://libreoffjce-from-collabora.com

Affected areas

slide-15
SLIDE 15

Calc Affected by core change

95 %

Non-scientific estimate

slide-16
SLIDE 16

Undo / Redo Content Rendering Cell Comment Cell Editing Excel Import / Export Named Range Database Range ODS Import / Export Sorting Find & Replace Live Spellcheck Formula Dependency Copy & Paste Reference Updates UNO API Layer VBA API Layer RTF Import Quattro Pro Import HTML Import / Export External Reference DIF Import / Export SYLK Import / Export DBF Import / Export CppUnit Test Change Tracking CSV Import / Export Conditional Formatting Chart Data Provider Cell Validation Formula Calculation Formula Tokenization Case Conversion Autofilter ...

What features are affected?

slide-17
SLIDE 17

https://libreoffjce-from-collabora.com

Expectation vs Reality

slide-18
SLIDE 18

20 to 50% of the code change would cause regressions. Almost all code changes caused regressions in some form. Some did more than others. Check #1

slide-19
SLIDE 19

The worst part is behind us. We just need to fix trivial bugs. The worst part was yet to come. Lots of medium-to-large follow-up refactoring ensued. Check #2

slide-20
SLIDE 20

Just focus on regressions during the 4.2 releases, and go back to normal for the 4.3. We did fix the worst ones in the 4.2

  • cycle. But many still remain.

Check #3

slide-21
SLIDE 21

We already wrote a lot of unit tests for Calc core prior to the change. They should keep us safe. We ended up doubling the amount

  • f unit tests for Calc during the 4.2
  • period. We still don’t have enough.

Check #4

slide-22
SLIDE 22

As a responsible coder, I will fix all the bugs my change caused. Calc’s core is too large for one coder to handle. We need multiple people who can handle bugs in Calc core. Check #5

slide-23
SLIDE 23

https://libreoffjce-from-collabora.com

Going forward

slide-24
SLIDE 24

Challenges we face

  • Squash remainder of regressions caused

by the core change. The number still too high.

  • Gather more people becoming

comfortable handling bug fjxes in Calc core.

  • Build the culture of writing unit test for

each and every bug fjx.

slide-25
SLIDE 25

Unit test is key

  • One unit test is worth 20 future bug

fjxes.

  • A bug fjx does not fjnish until you

write a test.

  • Writing unit test is courtesy for your

fellow developers.

  • We really don’t have a choice.
slide-26
SLIDE 26

Unit test is key (repeated)

  • A bug fjx without a unit test WILL GET

BROKEN AGAIN in the next release.

  • A bug fjx with a unit test WILL

REMAIN FIXED FOREVER.

Which one will be your choice?

slide-27
SLIDE 27

https://libreoffjce-from-collabora.com

THANKS!