Kshitiz Arya <aryakshiti...@gmail.com> added the comment:
I have timed the execution of if-else and match-case on Differ().compare from difflib module and here is what I got When both strings are same ********************************************************************************************** if-else: 2.504900476196781e-06, match-case: 2.587399649200961e-06, comparisions : 10 if-else: 2.222519979113713e-06, match-case: 1.7874199693324045e-06, comparisions : 100 if-else: 1.954343999386765e-06, match-case: 1.8695319959078916e-06, comparisions : 1000 if-else: 3.2847548005520366e-06, match-case: 1.928162499825703e-06, comparisions : 10000 if-else: 1.2241538699890953e-06, match-case: 7.870903900038684e-07, comparisions : 100000 if-else: 7.950048359998618e-07, match-case: 7.883418589990469e-07, comparisions : 1000000 if-else: 7.941918295000505e-07, match-case: 7.882559125006082e-07, comparisions : 10000000 if-else: 7.928842861700104e-07, match-case: 7.855620772999828e-07, comparisions : 100000000 ********************************************************************************************** When strings have some difference ********************************************************************************************** if-else: 2.7084999601356687e-06, match-case: 2.6756002625916154e-06, comparisions : 10 if-else: 2.207159996032715e-06, match-case: 1.8606500088935719e-06, comparisions : 100 if-else: 2.139014999556821e-06, match-case: 1.928671001223847e-06, comparisions : 1000 if-else: 2.682303600158775e-06, match-case: 2.626289399631787e-06, comparisions : 10000 if-else: 1.1338948200136655e-06, match-case: 7.989683500636602e-07, comparisions : 100000 if-else: 7.862168830033624e-07, match-case: 7.83532044995809e-07, comparisions : 1000000 if-else: 7.918311449997419e-07, match-case: 7.843428884996683e-07, comparisions : 10000000 if-else: 7.843063791000168e-07, match-case: 7.842913352399773e-07, comparisions : 100000000 ********************************************************************************************** ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44276> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com