Post Reply 
Little explorations with HP calculators (no Prime)
12-29-2018, 07:35 AM
Post: #334
RE: Little explorations with HP calculators (no Prime)
(12-27-2018 11:58 PM)DavidM Wrote:  I'll need more time to analyze your implementation of match_count, though, as its use of the "blue" variable is puzzling me.

Not sure if that's still the case after Albert's version. Otherwise persist and feel free to ask questions.

Quote:Despite your code being much more compact, it was a bit slower on my laptop (506 seconds vs. 483 seconds for my original version).

Performance wasn't my primary concern. I just thought you might like the more functional approach.
I've never compared the performance differences between list comprehensions and generator functions.
But I try to use the latter when I expect huge sequences of data to avoid loading all of it into memory.

In this context I can recommend Generator Tricks for Systems Programmers.

Cheers and have fun with Python
Thomas
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Little explorations with HP calculators (no Prime) - Thomas Klemm - 12-29-2018 07:35 AM



User(s) browsing this thread: 1 Guest(s)