Python Forum
how good is the optimization?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how good is the optimization?
#1
how good is the optimization in Python? in this code will it cache the value from s[n] or will it fetch it twice?

   if s[n]<128 or s[n]>191:
        return -2
or should i code this?

    x = s[n]
    if x<128 or x>191:
        return -2
for best performance.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
how good is the optimization? - by Skaperen - Aug-09-2018, 04:54 AM
RE: how good is the optimization? - by Gribouillis - Aug-09-2018, 05:52 AM
RE: how good is the optimization? - by DeaD_EyE - Aug-09-2018, 07:16 AM
RE: how good is the optimization? - by Gribouillis - Aug-09-2018, 03:18 PM
RE: how good is the optimization? - by nilamo - Aug-09-2018, 06:14 PM
RE: how good is the optimization? - by micseydel - Aug-09-2018, 08:57 PM
RE: how good is the optimization? - by Skaperen - Aug-10-2018, 12:23 AM
RE: how good is the optimization? - by Gribouillis - Aug-10-2018, 06:00 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020