473,320 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 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 2304
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.