472,954 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,954 software developers and data experts.

thousands/millions of objects

I am re-creating an application that is outdated and originally created
in C++

This app, reads values in, creates objects for each line and populates
fields, then runs some conditions on the data setting various flags,
then outputs it all to a dbf (foxpro) database.

I want to keep the structure somewhat similar to the c++ code, and as a
result I will create a new object for every line read in, this could be
hundreds/thousands/millions of entries.

What should I keep in mind when I know I will be creating this large
number of objects, i guess foremost, uses classes not structs so they
are are not stored on the heap.

any other pointers/advice before I embark? I havent designed an app in
c# that I know will hold massive amounts of information like this, just
want to make sure i have my ducks in a row

Feb 14 '06 #1
6 2287
DKode <dk****@gmail.com> wrote:
I am re-creating an application that is outdated and originally created
in C++

This app, reads values in, creates objects for each line and populates
fields, then runs some conditions on the data setting various flags,
then outputs it all to a dbf (foxpro) database.

I want to keep the structure somewhat similar to the c++ code, and as a
result I will create a new object for every line read in, this could be
hundreds/thousands/millions of entries.

What should I keep in mind when I know I will be creating this large
number of objects, i guess foremost, uses classes not structs so they
are are not stored on the heap.

any other pointers/advice before I embark? I havent designed an app in
c# that I know will hold massive amounts of information like this, just
want to make sure i have my ducks in a row


Well, I suspect you meant "structs rather than classes" but I'd
recommend using classes anyway.

There is no problem in creating millions of objects in .NET so long as
you have enough memory to handle them all. Keeping an object on the
heap only incurs a small overhead (about 8 bytes currently, I believe,
plus 4 for the reference to the object on x86).

One way to reduce the memory might be to process batches of thousands
of lines at a time rather than millions - do you actually need to read
the *whole* file in before creating/modifying the database?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Feb 14 '06 #2
I would have no problem reading in perhaps 10,000 lines first,
processing them and then sending them to the FoxPro database, then
reading the next 10,000 etc...

I am wondering if after re-designing this it will be as fast as the C++
equivalent, i've seen alot of people some specific processes in c++ are
still faster than doing the same in c#

Feb 14 '06 #3
DKode <dk****@gmail.com> wrote:
I would have no problem reading in perhaps 10,000 lines first,
processing them and then sending them to the FoxPro database, then
reading the next 10,000 etc...
In that case you should have no problems at all.
I am wondering if after re-designing this it will be as fast as the C++
equivalent, i've seen alot of people some specific processes in c++ are
still faster than doing the same in c#


I'd expect the bottleneck to be the database operations, personally.
The speed of those will depend on the driver, I imagine.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Feb 14 '06 #4
where can I find information about working with FoxPro under C#?

thanks you! You have been very helpful!

Feb 14 '06 #5
DKode,

In order to use FoxPro in C#, you should probably use the classes in the
System.Data.Odbc namespace, and use an ODBC driver for FoxPro.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"DKode" <dk****@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
where can I find information about working with FoxPro under C#?

thanks you! You have been very helpful!

Feb 14 '06 #6
DKode <dk****@gmail.com> wrote:
where can I find information about working with FoxPro under C#?
If you search for FoxPro C# in Google you get quite a few hits. This
one seems pretty useful:

http://msdn.microsoft.com/library/de...l=/library/en-
us/dv_foxhelp/html/fotskaccessingvisualfoxprodatainvisualstudionet.as p
thanks you! You have been very helpful!


My pleasure.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Feb 14 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: murray_shane56 | last post by:
I have a custom application that on occasion requires thousands of TSQL files (on the file system) to be compiled to the database. What is the quickest way to accomplish this? We currently...
6
by: Gary Frank | last post by:
What are the ramifications if I were to instantiate an object tens of thousands of times and add them to an array? Or hundreds of thousands of times? Do you know if the act of instantiating a...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
1
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.