[LLVMdev] Statistics of add/remove case operations for switches

Stepan Dyatkovskiy stpworld at narod.ru
Mon Oct 22 01:29:38 PDT 2012


Hi all,

Some numbers:

Total switches count..........................16636
Total cases added.............................78682
Total cases removed...........................575

Switches with removals........................277
Rem/Add(in switched with removals)............0,3168762305
Switches melted away (all cases was removed)..8

Why I made this statistics.
New switches supposes that all cases should be sorted. After we made 
remove-case operations, we either need to rebuild switch internals or 
place tombstones in holes. If operation removes more than 50% of cases 
it is better to rebuild switch, if operation removes a tiny percent of 
cases, that it is better to place tombstone.

XLS file and patch with harness are in attachment.

-Stepan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SwitchAddRemoveStats.xls.tar.xz
Type: application/x-xz
Size: 208040 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121022/ab55bda6/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: switch-statistics-2.patch
Type: text/x-patch
Size: 3499 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121022/ab55bda6/attachment-0001.bin>


More information about the llvm-dev mailing list