Skip to main content

Timeline for Random IP Address Generator

Current License: CC BY-SA 4.0

5 events
when toggle format what by license comment
Jul 26, 2018 at 15:11 comment added Ludisposed Yes it shouldn't matter much and is dependent on the data. I agree with your reasoning for choosing a generator.
Jul 26, 2018 at 15:01 comment added 301_Moved_Permanently @Ludisposed My own testing indicates 5.792979179001122 seconds for 1 million calls to random_ipv4 using a generator expression and 5.526552320003248 using a list-comprehension. Nothing really conclusive to prefer one over the other. And since we aren't to re-use the result, a generator expression is a good indication of that.
Jul 26, 2018 at 14:49 comment added 301_Moved_Permanently @Ludisposed Found old timings at bytes.com/topic/python/answers/… But for join it shouldn't matter much as the current implementation convert the input to a list right away.
Jul 26, 2018 at 14:01 comment added Ludisposed CMIIW, but aren't list comprehension a bit faster than generator comprehension when memory is not an issue?
Jul 26, 2018 at 12:48 history answered 301_Moved_Permanently CC BY-SA 4.0