Closed Thread
Results 1 to 4 of 4

Thread: Optimization

  1. #1
    exile_9999 is offline Newbie
    Join Date
    Aug 2009
    Posts
    1
    Rep Power
    0

    Optimization

    Hello! I am a beginner programmer. I have a problem with the runtime of one of my applications.

    I have a website application that tries to compute for recommended objects to users. The recommended results is based on the user as well as the currently viewed object.

    My problem is, I have 500 objects and almost 30 users. What I do is, for each user, I compute the value for recommendation for EACH artwork. So that means, for 1 object, I compare ALL of the other objects to it. Then after the computation, I store it in the Database. So for each user, I have around 250000 records inside the Database.

    Can I have any tips regarding on how to optimize it? Either some changes to the Database model or some changes to the code. I have 3 FOR loops (1 for user, 1 for viewed object, 1 for target objects). I have already tried using UNION ALL, but the INSERT statements doesn't seem to be the case.

    Help please!

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Posts
    2,487
    Rep Power
    33

    Re: Optimization

    Well your math I believe is wrong, I think its closer to 75,000 maybe in your tests you forgot to delete a few things, if you just completed some tests it might be the only reason its going slow now since I think sql can handle 75,000 in a very decent time.

    If you posted your code we could have a better idea of how to help you out on this one.

  4. #3
    Join Date
    Jul 2006
    Posts
    16,491
    Blog Entries
    75
    Rep Power
    143

    Re: Optimization

    This is going to depend HEAVILY on how you are computing these values. It looks like you're dealing with a typical space/time trade off in efficiency, however. You can compute everything once and store the results, or compute everything on the fly each time.

    Also, in many instances 250,000 records is not much data. Is there a way to get the object-object data to be user independent?
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  5. #4
    Parabola's Avatar
    Parabola is offline Programming Professional
    Join Date
    Jul 2009
    Location
    Texas
    Posts
    336
    Blog Entries
    4
    Rep Power
    13

    Re: Optimization

    Is there any possibility we can see your code? It could help out some.
    Programmer (n): An organism that can turn caffeine into code.
    Programming would be so much easier without all the users.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. how to write pc optimization software?
    By fayyazlodhi in forum C# Programming
    Replies: 8
    Last Post: 07-09-2011, 01:55 AM
  2. Path Optimization
    By PGP_Protector in forum C# Programming
    Replies: 2
    Last Post: 05-27-2011, 12:10 PM
  3. need help for c optimization, take a look thanks
    By ayad001 in forum C and C++
    Replies: 1
    Last Post: 06-17-2008, 09:11 AM
  4. MySQL Optimization?
    By Void in forum Database & Database Programming
    Replies: 6
    Last Post: 01-07-2007, 11:06 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts