Python Forum
Which is Faster, List or SQL
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Which is Faster, List or SQL
#5
I ran the experiment on my machine without issues
Output:
>>> count = 100000000 >>> print "{:,}".format(count) 100,000,000 >>> myset = set(xrange(count)) >>> myset = set(xrange(count * 10)) >>>
If you're concerned, you should try running the experiment as well (though be mindful of the memory, swap, and thrashing issues).

Another alternative: https://github.com/Ezibenroc/PyRoaringBitMap

Lists will not be efficient though, and a database seems unnecessary unless you *really* run out of memory (in which case a list doesn't work anyway).
Reply


Messages In This Thread
Which is Faster, List or SQL - by AceScottie - Mar-16-2017, 06:29 PM
RE: Which is Faster, List or SQL - by micseydel - Mar-16-2017, 06:33 PM
RE: Which is Faster, List or SQL - by AceScottie - Mar-16-2017, 06:45 PM
RE: Which is Faster, List or SQL - by Larz60+ - Mar-16-2017, 06:41 PM
RE: Which is Faster, List or SQL - by micseydel - Mar-16-2017, 07:09 PM
RE: Which is Faster, List or SQL - by wavic - Mar-16-2017, 07:23 PM
RE: Which is Faster, List or SQL - by micseydel - Mar-16-2017, 07:44 PM
RE: Which is Faster, List or SQL - by zivoni - Mar-16-2017, 09:13 PM
RE: Which is Faster, List or SQL - by nilamo - Mar-16-2017, 09:26 PM
RE: Which is Faster, List or SQL - by AceScottie - Mar-16-2017, 10:15 PM
RE: Which is Faster, List or SQL - by wavic - Mar-16-2017, 10:23 PM
RE: Which is Faster, List or SQL - by Larz60+ - Mar-17-2017, 02:31 AM

Forum Jump:

User Panel Messages

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