|
-
December 12th, 2003, 09:34 AM
#1
little design question...
hi,
A friend of mine created an 'excell and macro's'-based application that he uses for the ranking of competitors (a bit like the WTA ranking system: competitores get points on each tournament that you have to defend one year later...).
But now that he inserted about 1000 competitors,...the excell-program really starts to slow down, and he also wanted to add some extra features to it...so he asked me if it would be possible to port it to a standalone VC++ application.
Now my question is -before I start coding- : Will the VC++ version (using the normal serialization and so) also start to slow down when the 'counter' hits 1000 entries?
Or should I consider making this a database-applicacation? (which I don't have a lot of experience with yet,...)
You see, I'd really give this program a shot when I'm certain of it's speed/stability whe having more than -let's say- 1500 or 2000 competitors in the list. Maybe this is a simple (stupid?) question but if someone could briefly tell me the limitations/pro's & con's of the different collection classes and so, that would really be helpful.
thx in advance!
-
December 12th, 2003, 10:52 AM
#2
2000 competitors? ...piece of cake!
In the C++ version, simply read/write 2000 records from/to a file and and process them, will be much more faster than using Excel VBA, that's for sure.
But if your problem is a little bit more complex, it's quite difficult to handle and process data, and to maintain the application because of a lot of hard-coded stuff.
So, port it to C++ but use a database!.
If you don't have a lot of experience using databases, what's the problem?
Just start digging
-
December 12th, 2003, 11:37 AM
#3
Depending on the computations or data massaging you're planning on doing with the 2000 "records" and, of course, the machine you're running on, speed should not be a problem in C++. If you're looking to expand your number of records to 10,000+ you may see speed gains by using STL collections as opposed to the MFC collections.
What to use and how to use it really depends on what you're doing with the data and what you plan to do in the future. Using a database, such as access, may or may not be of use or may not provide enough benefit for the developement cost (the time it takes you to get up to speed, the additional overhead, etc). Other considerations would be ease of transfering the data and/or sharing the data. From the scant details provided, I'd be hesitant to recommend a data base solution, not that it's a bad idea, but more that it's like putting a V-8 on a lawn mower.
Off the top of my head, I'd be tempted to wirte a CSV importer, save the data in XML and store it in memory in a STL map, probably encompassed in a SDI application with multiple views...
If you do decide to not go the data base route, you should abstract your data access so that you can easily switch it over if it should become more of a requirement...
bytz
--This signature left intentionally blank--
-
December 12th, 2003, 01:07 PM
#4
the reason I wasn't quite sure of the speed was that the program would require a function that iterates through all the records (at regular times) to update the new number of points that each competitor has (as I described in the 1st post : just like the WTA ranking system -> check if competitor participated,...if not: remove the points he earned one year before...)
Also with the writing/reading to/from a CFile with 1000+ or 1500+ records was something I've never tried before...
but with the info in the previous post I think I'll give it a shot without a database.
thanks for the advice!
-
December 12th, 2003, 01:47 PM
#5
I have no clue what WTA is, sorry. On reading and writing records, either do it through XML ('cuz you should be easily able to add fields etc...) or you could read and write the records as a chunk, i.e. the first piece read or written is the count, then you alloc a memory block the size of num_records * record struct size; do your modifications and write the chunk back out. You could store it in a comma delimited file... but even in that case you'd read the file into memory before parsing it.
bytz
--This signature left intentionally blank--
-
December 12th, 2003, 01:53 PM
#6
oops...sorry 
WTA = Women Tennis Association, that friend of mine 'created' a similar points-ranking system (the one he made in VB-Excell)...he wanted to use this style of ranking competitors for his sport...
kinda funny with all these abbreviations...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|