tchncs
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
RSS Bot@lemmy.bestiver.seMB to Lobste.rs@lemmy.bestiver.seEnglish · 1 month ago

Python Performance: Why 'if not list' is 2x Faster Than Using len()

blog.codingconfessions.com

external-link
message-square
0
link
fedilink
  • cross-posted to:
  • python@programming.dev
  • technology@lemmy.world
3
external-link

Python Performance: Why 'if not list' is 2x Faster Than Using len()

blog.codingconfessions.com

RSS Bot@lemmy.bestiver.seMB to Lobste.rs@lemmy.bestiver.seEnglish · 1 month ago
message-square
0
link
fedilink
  • cross-posted to:
  • python@programming.dev
  • technology@lemmy.world
Discover why 'if not mylist' is twice as fast as 'len(mylist) == 0' by examining CPython's VM instructions and object memory access patterns.

Comments

alert-triangle
You must log in or register to comment.

Lobste.rs@lemmy.bestiver.se

lobsters@lemmy.bestiver.se

Subscribe from Remote Instance

You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !lobsters@lemmy.bestiver.se
lock
Community locked: only moderators can create posts. You can still comment on posts.

RSS Feed of lobste.rs

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 12 users / day
  • 132 users / week
  • 358 users / month
  • 628 users / 6 months
  • 2 local subscribers
  • 170 subscribers
  • 1.71K Posts
  • 102 Comments
  • Modlog
  • mods:
  • patrick@lemmy.bestiver.se
  • RSS Bot@lemmy.bestiver.se
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org