Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9004893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:00:17+00:00 2026-06-16T01:00:17+00:00

Just a query into both personal experience and understanding of limitations etc. If I

  • 0

Just a query into both personal experience and understanding of limitations etc. If I had, for example, a text file with 100,000 lines (entries) and a database with 100,000 identical entries, each containing one word and no doubles, which one would I be able to process faster and which would consume the least memory?

It is my understanding that I could load the entire text file into onto memory into a list at the start (only about 1MB.) This information is being used to confirm string contents. Every word (delimited by a space) in the string has to exist in the file or else it gets changed to the most similar entry in the list. In a nutshell, it’s very high-level auto-correct. Sadly, however, I have to reinvent the wheel.

So anyway, my question still stands. Which is my best choice? I’m trying to use the fewest external modules possible, so I’m thinking I might stick with SQLite (it’s standard, is it not? Though one more can’t hurt) If newline delimited text files are both my fastest and most economical option, is there a specific way I should go about handling them? I want this script to be able to perform at least 100 match operations in a second, if that’s computationally possible with a language such as Python.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T01:00:19+00:00Added an answer on June 16, 2026 at 1:00 am

    If you load all 100,000 words into a Python set, determining whether a given word is in that set will be O(1) – it doesn’t get any faster than that. The penalty will be a delay when launching your python app because Python has to load all data, it’ll be on the order of a couple of seconds.

    If you load the words into SQLite (or any other SQL database), you’d need a hash-based index to achieve the same order of performance. I’m not sure if SQLite has that index type. MySQL doesn’t.

    SQL databases usually don’t have a function to find ‘similar’ words, because every user has his own definition of ‘similar’. It’ll be much easier implementing that in Python, but maybe the database of your choice has something that’s exactly what you’re looking for.

    The best choice depends on other requirements you didn’t mention. Do the 100,000 words change frequently? Do other people (non-programmers) appart from you need to maintain them? If so, a database might be more convenient, and you might want to trade speed for that. Also, how often do you launch your Python app? If you run it to test single words, you’ll wait a couple of seconds for each word. On the other hand, if you write a daemon/server and add an interface (sockets, HTTP, whatever), you only have to load your data once and you can throw loads of words at it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just ran into a SQL query with about 5 different columns in the
I just can't figure out how to optimize this into one query in HQL.
Using just an sql query is it possible to write the contents of a
I have a problem, i have a query that just simply displays the user
i just want limit a query by parameter inside a stored, but I get
Just wondering how the following sql query would look in linq for Entity Framework...
I just came across a query that does an inner join on a non-distinct
I just saw a sqlite query and I cannot find what is it mean
Just now I needed to do something like the following query, and was surprised
I just decided to replace phpMyAdmin by Mysql Query Browser ( finally I can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.