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

  • SEARCH
  • Home
  • 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 6223705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:32:10+00:00 2026-05-24T08:32:10+00:00

I need advice regarding text analysis. The program is written in php. My code

  • 0

I need advice regarding text analysis.
The program is written in php.

My code needs to receive a URL and match the site words against the DB and seek for a match.

The tricky part is that the words aren’t allways written in the DB as they appear in the text.

example:

Let’s say my DB has these values:
Word = letters

And the site has:
Wordy thing

I’m supposed to output:
Letters thing

My code makes several regex an after each one tries to match the searched word against the DB.

For each word that isn’t found I make 8 queries to the DB. Most of the words don’t have a match so when we talk about a whole website that has hundreds of words my CPU level makes a jump.

I thought about storing every word not found in the DB globaly as they appear ( HD costs less than CPU ) or maybe making an array or dictionary to store all of that.

I’m really confused with this project. It’s supposed to serve a lot of users, with the current code the server will die after 10-20 user requests.

Any thoughts?

Edit:
The searched words aren’t English words and the code runs in a windows 2008 server

  • 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-05-24T08:32:11+00:00Added an answer on May 24, 2026 at 8:32 am

    Thank you all for your answers.
    Unfortunately none of the answers helped me, maybe I wasn’t clear enough.

    I ended up solving the issue by creating a hash table with all of the words on the DB (about 6000 words), and checking against the hash instead of the DB.

    The code started up with 4 sec execution time and now it’s 0.5 sec! 🙂

    Thanks again

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

Sidebar

Related Questions

I need advice regarding subselect performance in MySQL. For a reason that I can't
I need advice on how to have my C# console application display text to
HI everyone, i need some advice regarding Visual Studio 2008 Pro. We develop a
I need some advice regarding how to organize my data for effective and fast
in my program i need to write large text files (~300 mb), the text
I need some clarification/advice regarding modifying objects stored in mutable containers in Objective-C. Let's
I need some advice as to how I easily can separate test runs for
I need some expect advice on how to handle the following:- I have a
Need a function like: function isGoogleURL(url) { ... } that returns true iff URL
I need the advice from someone who knows Java very well and the memory

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.