Overclock.net › Forums › Industry News › Software News › [I-Programmer] Drive to remove unused code in LibreOffice
New Posts  All Forums:Forum Nav:

[I-Programmer] Drive to remove unused code in LibreOffice  

post #1 of 8
Thread Starter 
Quote:
Thanks to the efforts of its volunteer taskforce, over half the unused code in LibreOffice has been removed over the past six months. It's good to see this clean-up operation but it does raise questions about the amount of dead code lurking out there in the wild.
Carrying around unwanted and unused code is a real burden - it slows performance and makes code more difficult to maintain.

Michael Meeks, a longtime OpenOffice.org developer who is now one of the seven board members of The Document Foundation, has produced a graph that shows how the number of identified unused methods has dropped from nearly 5200 to around 2000. Meeks writes:
Quote:
It seems that over half of our unused code has now bitten the dust. Unfortunately as we remove more, more wastage tends to be revealed, which explains some of the upward jumps in the graph, nevertheless the trend is clearly down. One of the side benefits of the unsung heroes working at the conversion of our old-style macro driven generics to modern STL is that this loses us several unused methods per class converted.

It is a worthy but sobering enterprise. To remove dead code is a good thing, but how can we have reached this point and seriously be discussing a situation where dead code is allowed to remain undetected and unremoved for so long?

The scale of the dead code in LibreOffice is shocking, and it probably isn't because the code base is especially bad. Can you imagine this in any other engineering discipline? Oh yes, we built the bridge but there are a few hundred unnecessary iron girders that we forgot to remove... Oh yes, we implemented the new chip but that area over there is just a few thousand transistors we no longer use... and so on.

461

source
post #2 of 8
Not entirely sure how dead code slows performance...

After all, if it doesn't run... it ain't doing anything.

The fastest code is code that doesn't run! - Raymond Chen
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
post #3 of 8
It may not do anything if its unused but it still takes up extra hdd space. Some people are obsessed with optimization and zero wasted space. OCD people in particular like myself would love this. It makes you wonder how much dead code is floating around in everything we use daily.
 
Micromachine
(8 items)
 
 
CPUMotherboardGraphicsRAM
i7 4500u Inspiron 15 7000 Integrated 8gb 
Hard DriveOSMouse
120gb Samsung EVO SSD Debian Logitech m705 
CPUMotherboardRAMHard Drive
AMD 5350 Kabini AsRock AM1H-ITX 8gb Gskill Ripjaws (2x4) Samsung 120 Evo 
Hard DriveHard DriveOSCase
WD 1tb 2.5 WD 2tb USB 3.0 Ubuntu Server 16.04 Antec ISK 
  hide details  
 
Micromachine
(8 items)
 
 
CPUMotherboardGraphicsRAM
i7 4500u Inspiron 15 7000 Integrated 8gb 
Hard DriveOSMouse
120gb Samsung EVO SSD Debian Logitech m705 
CPUMotherboardRAMHard Drive
AMD 5350 Kabini AsRock AM1H-ITX 8gb Gskill Ripjaws (2x4) Samsung 120 Evo 
Hard DriveHard DriveOSCase
WD 1tb 2.5 WD 2tb USB 3.0 Ubuntu Server 16.04 Antec ISK 
  hide details  
post #4 of 8
Quote:
Originally Posted by Tadaen Sylvermane View Post

It may not do anything if its unused but it still takes up extra hdd space. Some people are obsessed with optimization and zero wasted space. OCD people in particular like myself would love this. It makes you wonder how much dead code is floating around in everything we use daily.


That's a good point. I can see how it could be more significant on portable devices and such too.

AMD Build
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Ryzen 1700 ASRock AB350M Pro4 Sapphire Radeon NITRO Rx 480 8GB 2x8GB DDR4 - Corsair Vengeance LPX 16GB @ 2666 
Hard DriveCoolingOSMonitor
Samsung Evo 960 M.2 Wraith Spire Windows 10 x64 Pro LG 27U68 - 27in - 4K -IPS 
KeyboardPowerCaseMouse
Cherry MX Red w/ White LEDs Corsair HX1050W Gold Corsair 88R mATX Logitech G500 
Mouse Pad
RatPadz XL 
  hide details  
AMD Build
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Ryzen 1700 ASRock AB350M Pro4 Sapphire Radeon NITRO Rx 480 8GB 2x8GB DDR4 - Corsair Vengeance LPX 16GB @ 2666 
Hard DriveCoolingOSMonitor
Samsung Evo 960 M.2 Wraith Spire Windows 10 x64 Pro LG 27U68 - 27in - 4K -IPS 
KeyboardPowerCaseMouse
Cherry MX Red w/ White LEDs Corsair HX1050W Gold Corsair 88R mATX Logitech G500 
Mouse Pad
RatPadz XL 
  hide details  
post #5 of 8
Besides, dead code gunks up the source. Not a nice thing.
post #6 of 8
Wow. That's just poor project management to allow that much dead code to build up.
post #7 of 8
Despite it not being used, memory may still be allocated for the code.
v4.1.2
(18 items)
 
  
CPUMotherboardGraphicsRAM
AMD Ryzen 5 1600X ASUS ROG Crosshair VI Hero AMD Radeon Vega Frontier Edition Team Dark Pro 16GB (8GBx2)  
Hard DriveHard DriveHard DriveCooling
SAMSUNG 960 EVO M.2 250GB Crucial BX300 480GB Seagate Barracuda 1TB Watercool HEATKILLER IV 
CoolingCoolingCoolingOS
EK-FC Radeon Vega EK-CoolStream XE 360 Radiator Monsoon MMRS Reservoir Windows 10 LTSB-N 
MonitorKeyboardPowerCase
Dell Ultrasharp U2311H Logitech G510s Corsair AX750 NZXT Switch 810 
MouseOther
Logitech G502 Proteus Spectrum  APC BX1000G UPS 
  hide details  
v4.1.2
(18 items)
 
  
CPUMotherboardGraphicsRAM
AMD Ryzen 5 1600X ASUS ROG Crosshair VI Hero AMD Radeon Vega Frontier Edition Team Dark Pro 16GB (8GBx2)  
Hard DriveHard DriveHard DriveCooling
SAMSUNG 960 EVO M.2 250GB Crucial BX300 480GB Seagate Barracuda 1TB Watercool HEATKILLER IV 
CoolingCoolingCoolingOS
EK-FC Radeon Vega EK-CoolStream XE 360 Radiator Monsoon MMRS Reservoir Windows 10 LTSB-N 
MonitorKeyboardPowerCase
Dell Ultrasharp U2311H Logitech G510s Corsair AX750 NZXT Switch 810 
MouseOther
Logitech G502 Proteus Spectrum  APC BX1000G UPS 
  hide details  
post #8 of 8
The author should take a look at his own site before calling out LibreOffice developers. Right now the entire site is dead.
Quote:
Catchable fatal error: Argument 1 passed to TeraWurfl::addTopLevelSettings() must be an array, null given, called in /home/iprogr6/public_html/plugins/mobile/terawurfl/TeraWurfl.php on line 334 and defined in /home/iprogr6/public_html/plugins/mobile/terawurfl/TeraWurfl.php on line 463

Come on, if it's a "catchable" error, why didn't you catch it? lachen.gif

On topic: Cruft isn't really that bad for performance, but it's very bad for maintenance. Too much cruft makes makes it difficult to find what is still being used amongst the mess, and means that people will just let bad (but used) code rot with the dead code. This isn't going to decrease performance, but it makes it nearly impossible to improve, because the quick hack that someone wrote back in 2006 which they were going to fix up in the next version is going to hide away for eternity.

A secondary benefit of taking the plunge and looking for dead code is that you'll inevitably stumble across the aforementioned bad hacks and be able to improve them.
    
CPUMotherboardGraphicsRAM
i7 920 D0 MSI X58 Pro-E Gigabyte GTX 970 (GV-N970IX-4GD) 3x2GB G.Skill DDR3-1333 9-9-9-24 
Hard DriveHard DriveOptical DriveOS
840 Pro Caviar Black LG BD-ROM Windows 8.1 Pro x64 
MonitorMonitorKeyboardPower
Dell U2713HM Dell U2311H Turbo-Trak (Google it :D) Corsair HX-520 
CaseMouseMouse PadAudio
CM690 Mionix Avior 7000 Everglide Titan AKG K 242 HD 
  hide details  
    
CPUMotherboardGraphicsRAM
i7 920 D0 MSI X58 Pro-E Gigabyte GTX 970 (GV-N970IX-4GD) 3x2GB G.Skill DDR3-1333 9-9-9-24 
Hard DriveHard DriveOptical DriveOS
840 Pro Caviar Black LG BD-ROM Windows 8.1 Pro x64 
MonitorMonitorKeyboardPower
Dell U2713HM Dell U2311H Turbo-Trak (Google it :D) Corsair HX-520 
CaseMouseMouse PadAudio
CM690 Mionix Avior 7000 Everglide Titan AKG K 242 HD 
  hide details  
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Software News
This thread is locked  
Overclock.net › Forums › Industry News › Software News › [I-Programmer] Drive to remove unused code in LibreOffice