Skip to content

Conversation

adrian-kong
Copy link
Contributor

No description provided.

@adrian-kong
Copy link
Contributor Author

using this branch on solution pos
Screenshot 2023-04-03 at 9 39 18 am

using silverjam/py311
Screenshot 2023-04-03 at 9 44 13 am

seems like switch is slower (?)
might be better readability but not really i guess. can disregard this change

@adrian-kong adrian-kong requested a review from silverjam April 2, 2023 23:46
@adrian-kong
Copy link
Contributor Author

#1002

Base automatically changed from silverjam/py311 to main April 3, 2023 00:48
@silverjam
Copy link
Contributor

silverjam commented Apr 3, 2023

Maybe a diction lookup to some functions would be faster?

E.g. move the body of each if/else into a function, associate those functions with the message types they handle, lookup the handler based on the message type and call the handler. This would incur the overhead of a function call for each message though so not sure if that'd be faster than the simple if/else.

@adrian-kong
Copy link
Contributor Author

hmm yea maybe - was hoping the python bump can use some cool match statements but nvm.
might be too tiny to measure performance changes on if elses to using map lookups, will just close this PR :(

@adrian-kong adrian-kong closed this Apr 3, 2023
@adrian-kong adrian-kong deleted the adrian/switch_case branch April 3, 2023 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants