Skip to content
Advertisement

Tag: switch-statement

Python Match Case (Switch) Performance

I was expecting the Python match/case to have equal time access to each case, but seems like I was wrong. Any good explanation why? Lets use the following example: And define a quick tool to measure the time: If we run each 10000000 times each case, the times are the following: Just wondering why the access times are different. Isn’t

Advertisement