[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Speed measurements of partman [was: Some reflections on the future of partman]



On Tue, Jul 20, 2004 at 01:45:15PM -0400, Joey Hess wrote:
> 
> The third option is merely to optimise it. partman forks a hell of a
> lot, and it sources the libraries over and over.

The busybox sh forks almost on every line of partman.  It forks even for
internal commands such as [ and echo.

Today I made some measurements on my computer.  Forking and loading a
new interpreter takes 3.94 ms (miliseconds) and sourcing definitions.sh
takes 10.82 ms. 

The code in the functions ask_user and debconf_select takes quiet a lot
of time - 387ms for the main partitioning menu and 282ms for the edit
partition menu.  This is about half of the time required to draw these
menus.  (These times do not include the time spend in the various
choices scripts, only the code of ask_user and debconf_select.)

Some statistics follow.  The biggest numbers include the time for
ask_user and debconf_select.  The jfs, reiserfs and xfs file systems
produce smaller numbers because their kernel modules were not loaded.
I don't know what conclusions to make from these statistics.

===================================================================
REDRAW THE MAIN PARTITIONING SCREEN (selecting an empty line in it)

Total time elapsed: 651,723ms

 9 forks of new interpreters:                               35,5ms or  5,4%
definitions.sh sourced  1 times:                            10,8ms or  1,7%

Inside partman:                                            397,1ms or 60,9%
Inside choose_partition/60partition_tree/choices:          198,5ms or 30,5%
Inside choose_partition/30lvm/choices:                      10,5ms or  1,6%
Inside choose_partition/90finish/choices:                    9,2ms or  1,4%
Inside choose_partition/80undo/choices:                      9,2ms or  1,4%
Inside choose_partition/45auto/choices:                      8,6ms or  1,3%
Inside choose_partition/50help/choices:                      8,6ms or  1,3%
Inside choose_partition/65divider_down/choices:              4,4ms or  0,7%
Inside choose_partition/55divider_up/choices:                3,4ms or  0,5%
Inside choose_partition/55divider_up/do_option:              2,2ms or  0,3%

===================================================================
FROM EDIT PARTITION SCREEN BACK TO MAIN PARTITIONING MENU

Total time elapsed: 652,703ms

 9 forks of new interpreters:                               35,5ms or  5,4%
definitions.sh sourced  1 times:                            10,8ms or  1,7%

Inside partman:                                            380,8ms or 58,3%
Inside choose_partition/60partition_tree/choices:          195,3ms or 29,9%
Inside choose_partition/60partition_tree/do_option:         20,4ms or  3,1%
Inside choose_partition/30lvm/choices:                      10,2ms or  1,6%
Inside choose_partition/50help/choices:                      9,8ms or  1,5%
Inside choose_partition/90finish/choices:                    9,4ms or  1,4%
Inside choose_partition/80undo/choices:                      9,3ms or  1,4%
Inside choose_partition/45auto/choices:                      8,5ms or  1,3%
Inside choose_partition/65divider_down/choices:              3,5ms or  0,5%
Inside choose_partition/55divider_up/choices:                3,3ms or  0,5%
Inside active_partition/80finish/do_option:                  2,2ms or  0,3%

===================================================================
FROM MAIN SCREEN TO EDIT PARTITION SCREEN

Total time elapsed: 631,532ms

17 forks of new interpreters:                               67,0ms or 10,6%
definitions.sh sourced  5 times:                            54,1ms or  8,6%

Inside choose_partition/60partition_tree/do_option:        342,4ms or 54,2%
Inside active_partition/65toggle_bootable/choices:          60,3ms or  9,5%
Inside active_partition/45ext3/choices:                     31,8ms or  5,0%
Inside partman:                                             29,3ms or  4,6%
Inside active_partition/70resize/choices:                   28,1ms or  4,5%
Inside active_partition/15method/choices:                   27,1ms or  4,3%
Inside active_partition/10change_name/choices:              23,2ms or  3,7%
Inside active_partition/30format/choices:                   11,7ms or  1,9%
Inside active_partition/45basicfilesystems/choices:         10,8ms or  1,7%
Inside active_partition/45reiserfs/choices:                 10,5ms or  1,7%
Inside active_partition/87delete/choices:                   10,1ms or  1,6%
Inside active_partition/45xfs/choices:                      10,1ms or  1,6%
Inside active_partition/80finish/choices:                    9,8ms or  1,6%
Inside active_partition/83copy/choices:                      9,3ms or  1,5%
Inside active_partition/45jfs/choices:                       9,2ms or  1,5%
Inside active_partition/75divider/choices:                   3,6ms or  0,6%
Inside active_partition/66change_flags/choices:              2,2ms or  0,4%
Inside active_partition/98chs/choices:                       2,2ms or  0,3%

===================================================================
REDRAW EDIT PARTITION SCREEN (selecting an empty line)

Total time elapsed: 597,203ms

17 forks of new interpreters:                               67,0ms or 11,2%
definitions.sh sourced  4 times:                            43,3ms or  7,2%

Inside choose_partition/60partition_tree/do_option:        326,7ms or 54,7%
Inside active_partition/65toggle_bootable/choices:          59,9ms or 10,0%
Inside active_partition/45ext3/choices:                     33,2ms or  5,6%
Inside active_partition/70resize/choices:                   30,8ms or  5,2%
Inside active_partition/15method/choices:                   30,3ms or  5,1%
Inside active_partition/10change_name/choices:              24,0ms or  4,0%
Inside active_partition/30format/choices:                   12,5ms or  2,1%
Inside active_partition/45basicfilesystems/choices:         11,3ms or  1,9%
Inside active_partition/45xfs/choices:                      10,0ms or  1,7%
Inside active_partition/87delete/choices:                    9,8ms or  1,6%
Inside active_partition/45reiserfs/choices:                  9,2ms or  1,5%
Inside active_partition/83copy/choices:                      8,7ms or  1,5%
Inside active_partition/80finish/choices:                    8,5ms or  1,4%
Inside active_partition/45jfs/choices:                       8,4ms or  1,4%
Inside active_partition/98chs/choices:                       4,9ms or  0,8%
Inside active_partition/75divider/choices:                   4,2ms or  0,7%
Inside active_partition/75divider/do_option:                 2,3ms or  0,4%
Inside active_partition/66change_flags/choices:              2,3ms or  0,4%

===================================================================
FROM EDIT PARTITION TO NEW METHOD SCREEN

Total time elapsed: 374,941ms

17 forks of new interpreters:                               67,0ms or 17,9%
definitions.sh sourced  2 times:                            21,6ms or  5,8%

Inside active_partition/15method/do_option:                172,0ms or 45,9%
Inside choose_method/25filesystem/choices:                  76,1ms or 20,3%
Inside choose_method/50lvm/choices:                         41,5ms or 11,1%
Inside valid_filesystems/80fat:                             12,4ms or  3,3%
Inside valid_filesystems/25xfs:                             11,6ms or  3,1%
Inside valid_filesystems/05ext3:                            10,5ms or  2,8%
Inside choose_method/70dont_use/choices:                     9,9ms or  2,6%
Inside choose_method/40swap/choices:                         9,9ms or  2,6%
Inside choose_partition/60partition_tree/do_option:          9,4ms or  2,5%
Inside valid_filesystems/20reiserfs:                         8,2ms or  2,2%
Inside valid_filesystems/25jfs:                              6,7ms or  1,8%
Inside valid_filesystems/10ext2:                             6,6ms or  1,8%

===================================================================
BACK TO EDIT PARTITION SCREEN (a new file system was chosen)

Total time elapsed: 1644,01ms

79 forks of new interpreters:                              311,3ms or 18,9%
definitions.sh sourced 21 times:                           227,2ms or 13,8%

Inside choose_partition/60partition_tree/do_option:        293,8ms or 17,9%
Inside update.d/50filesystems:                             229,3ms or 13,9%
Inside choose_method/25filesystem/do_option:               106,5ms or  6,5%
Inside update.d/21lvm_sync_flag:                            76,9ms or  4,7%
Inside active_partition/15method/do_option:                 70,4ms or  4,3%
Inside update.d/20bootable:                                 69,0ms or  4,2%
Inside update.d/80visual:                                   65,6ms or  4,0%
Inside active_partition/65toggle_bootable/choices:          60,3ms or  3,7%
Inside update.d/60basicmethods:                             53,2ms or  3,2%
Inside update.d/60swap:                                     38,1ms or  2,3%
Inside update.d/60lvm_visuals:                              36,3ms or  2,2%
Inside visual.d/size:                                       36,2ms or  2,2%
Inside update.d/20detected_filesystem:                      34,2ms or  2,1%
Inside valid_filesystems/80fat:                             33,2ms or  2,0%
Inside active_partition/70resize/choices:                   30,6ms or  1,9%
Inside valid_filesystems/05ext3:                            28,9ms or  1,8%
Inside active_partition/15method/choices:                   28,0ms or  1,7%
Inside active_partition/45basicfilesystems/choices:         27,9ms or  1,7%
Inside visual.d/number:                                     25,7ms or  1,6%
Inside visual.d/filesystem:                                 25,6ms or  1,6%
Inside active_partition/10change_name/choices:              24,0ms or  1,5%
Inside update.d/59default_visuals:                          22,9ms or  1,4%
Inside valid_filesystems/20reiserfs:                        22,6ms or  1,4%
Inside visual.d/type:                                       19,6ms or  1,2%
Inside valid_filesystems/25jfs:                             18,7ms or  1,1%
Inside valid_filesystems/25xfs:                             18,6ms or  1,1%
Inside visual.d/method:                                     18,1ms or  1,1%
Inside valid_filesystems/10ext2:                            17,0ms or  1,0%
Inside visual.d/mountpoint:                                 13,3ms or  0,8%
Inside visual.d/bootable:                                   13,3ms or  0,8%
Inside active_partition/30format/choices:                   12,5ms or  0,8%
Inside active_partition/87delete/choices:                   10,2ms or  0,6%
Inside active_partition/80finish/choices:                    9,7ms or  0,6%
Inside active_partition/45jfs/choices:                       9,4ms or  0,6%
Inside active_partition/45ext3/choices:                      9,3ms or  0,6%
Inside active_partition/45xfs/choices:                       9,1ms or  0,6%
Inside active_partition/83copy/choices:                      8,6ms or  0,5%
Inside active_partition/45reiserfs/choices:                  8,5ms or  0,5%
Inside active_partition/75divider/choices:                   3,3ms or  0,2%
Inside active_partition/66change_flags/choices:              2,9ms or  0,2%
Inside active_partition/98chs/choices:                       2,2ms or  0,1%

===================================================================
TOGGLE THE BOOTABLE FLAG

Total time elapsed: 4093,04ms

189 forks of new interpreters:                             744,7ms or 18,2%
definitions.sh sourced 85 times:                           919,7ms or 22,5%

Inside active_partition/65toggle_bootable/do_option:       685,6ms or 16,8%
Inside update.d/80visual:                                  338,0ms or  8,3%
Inside update.d/21lvm_sync_flag:                           313,8ms or  7,7%
Inside choose_partition/60partition_tree/do_option:        300,1ms or  7,3%
Inside update.d/50filesystems:                             297,7ms or  7,3%
Inside update.d/20bootable:                                280,9ms or  6,9%
Inside visual.d/size:                                      198,8ms or  4,9%
Inside update.d/60basicmethods:                            190,6ms or  4,7%
Inside update.d/60swap:                                    186,5ms or  4,6%
Inside update.d/60lvm_visuals:                             183,7ms or  4,5%
Inside update.d/20detected_filesystem:                     164,7ms or  4,0%
Inside update.d/59default_visuals:                         136,1ms or  3,3%
Inside visual.d/number:                                    129,5ms or  3,2%
Inside visual.d/filesystem:                                116,3ms or  2,8%
Inside visual.d/type:                                      100,0ms or  2,4%
Inside visual.d/mountpoint:                                 64,0ms or  1,6%
Inside active_partition/65toggle_bootable/choices:          58,6ms or  1,4%
Inside visual.d/method:                                     56,1ms or  1,4%
Inside visual.d/bootable:                                   47,5ms or  1,2%
Inside active_partition/70resize/choices:                   30,3ms or  0,7%
Inside active_partition/15method/choices:                   27,9ms or  0,7%
Inside active_partition/45basicfilesystems/choices:         27,8ms or  0,7%
Inside active_partition/10change_name/choices:              24,8ms or  0,6%
Inside valid_filesystems/80fat:                             12,5ms or  0,3%
Inside active_partition/30format/choices:                   11,7ms or  0,3%
Inside valid_filesystems/05ext3:                            10,6ms or  0,3%
Inside active_partition/45jfs/choices:                      10,1ms or  0,2%
Inside active_partition/45xfs/choices:                       9,9ms or  0,2%
Inside active_partition/87delete/choices:                    9,3ms or  0,2%
Inside active_partition/45ext3/choices:                      9,2ms or  0,2%
Inside active_partition/83copy/choices:                      8,6ms or  0,2%
Inside active_partition/80finish/choices:                    8,6ms or  0,2%
Inside active_partition/45reiserfs/choices:                  8,5ms or  0,2%
Inside valid_filesystems/25xfs:                              6,8ms or  0,2%
Inside valid_filesystems/25jfs:                              6,7ms or  0,2%
Inside valid_filesystems/10ext2:                             6,7ms or  0,2%
Inside valid_filesystems/20reiserfs:                         6,6ms or  0,2%
Inside active_partition/75divider/choices:                   3,4ms or  0,1%
Inside active_partition/66change_flags/choices:              2,3ms or  0,1%
Inside active_partition/98chs/choices:                       2,2ms or  0,1%


Anton Zinoviev



Reply to: