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 7600041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:48:48+00:00 2026-05-30T22:48:48+00:00

On every request of a webpage I have to multiply a matrix by a

  • 0

On every request of a webpage I have to multiply a matrix by a vector. The matrix is symmetric and (probably) sparse, with dimensions of approximately 500×500. The vector is a column taken out of another matrix with dimensions of approximately 500×100000. Now my question is how I store the matrices and execute the calculation in an effective way. I would like to do the calculations with php and store the matrices with mysql or on harddrive, but I assume there are better tools for this kind of task.

If you need to know anything further, don’t heasitate to ask!

  • 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-30T22:48:50+00:00Added an answer on May 30, 2026 at 10:48 pm

    OK, so we got a real corner-case here:

    • 500×100,000=50,000,000 elements. Depending on the data type, this
      translates to ca. 50M-400M of in-memory representation if we ignore
      sparsity and address by index. The matrix being symmetric reduces this to 25-200M
    • A non-zero density of 11% means, that an overhead of 9 Elements for
      sparse adressing is a break even – not really convincing for small
      data types, but might be an option for 64bit data types.

    Working from this gives strong argument to a two-tier solution:

    • A (shared) “data store server” (MySQL being the one option you
      mentioned)
    • and a (maybe PHP) frontend.

    Using PHP for a 500×500 matrix multiplication doesn’t seem to be a very efficient way to go: Loop overhead is quite high in PHP, so with so little done inside the loop, you might be wasting a bit of performance.

    I recommend to go for a slightly different solution: Write your own backend (maybe in C or C#), that

    • On startup reads the matrix into memory
    • Listens on a (local) socket for commands, e.g. “multiply”
    • Executes those commands on the matrix and given data and returns the result

    and feed it via PHP. This way you get the processing speed of a compiled language for the core function, while having the simplicity and web-centricity of PHP for the frontend.

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

Sidebar

Related Questions

I have a strange problem with in-app billing RESTORE_TRANSACTION command. Every request RESTORE_TRANSACTION request
It seems redundant to have zlib compress a web page during every request. It
In every ASP.NET application I have written, I would make number of request to
I have an ajax web application, where every 10 seconds I request content from
I have the following requirement: On every request to my web page, regardless of
I want to store data with every request (what user viewed what page of
Since http is stateless, every request to an app creates a new object. How
There are load balanced tomcat web servers. Every request could be served by different
i need help with logging Zend Framewrok application ( version 1.11 ), every request..
I would like to execute an Ajax request every seconds. My next code work

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.