News for hackers. Stuff that matters.
Re:Go + Services = One Goliath Project by WoodTree on Saturday December 21, 2019 @07:14PM (#21854193)
Nesting functions like this can have a bad performance impact because functions in Python are objects. Normally, all of those function objects are instantiated once when you load the module. However nested functions will be instantiated at runtime every time their parent is called, even if they aren’t used. This cost is perceptible in hot paths.
Re:Go + Services = One Goliath Project by krallja on Saturday December 21, 2019 @09:03PM (#21854652)
A lambda also behaves this way; it’s how it captures the closure scope.
Re:Go + Services = One Goliath Project by edflsafoiewq on Saturday December 21, 2019 @07:35PM (#21854292)
Are lambdas different?
Re:Go + Services = One Goliath Project by baron816 on Saturday December 21, 2019 @08:26PM (#21854508)
I’ve never seen it create a bottle neck, have you?
Re:Go + Services = One Goliath Project by weyland108 on Saturday December 21, 2019 @08:46PM (#21854588)
It will definitely be a problem if you use JIT interpreter like pypy