473,395 Members | 1,464 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,395 software developers and data experts.

C#-APP/FORM: Determining the most efficient Collections to store a wordlist

15
Programming Language: C#, .NET Framework 3.5
In this context, Form and App both describe a Microsoft Windows desktop application i'm creating.

I'm creating a wordlist generator. I need to be able to store each word in an efficient manner. I don't need to search the collection or modify it - I just need to be able to write every entry in the collection back into a text file. So, what is the best collection to use? I heard ArrayLists were not efficient. String arrays would consume a lot of resources (which I DO NOT want happening). HashTables have a key/pair value which I don't need, although the key could be the index (but that would not be the MOST EFFICIENT). Is there an efficient Collection to manage a list of hundreds of thousands of words?
Aug 15 '08 #1
8 3820
r035198x
13,262 8TB
Where did you hear that ArrayList is note efficient?
Aug 15 '08 #2
secutos
15
around the web. anybody have an answer?
Aug 15 '08 #3
cloud255
427 Expert 256MB
Well i never had any serious performance issues with array lists, but you could look at collections...

Do you want a data structure from the framework? If not you could use a linked list, thats pretty fast and only uses as much space as is needed.
Aug 15 '08 #4
Plater
7,872 Expert 4TB
How about a generic?
List<string> would be pretty good I would think. It's like an ArrayList except boxed especially for strings?
Aug 15 '08 #5
cloud255
427 Expert 256MB
How about a generic?
List<string> would be pretty good I would think. It's like an ArrayList except boxed especially for strings?
is the framework's list the same as a linked list?
Aug 15 '08 #6
Plater
7,872 Expert 4TB
Well I would hope that the frameworks implementation would be less costly then having to use unmanaged code in a managed environment?
For what it's worth, there's also:
LinkedList<string>
Aug 15 '08 #7
secutos
15
So if I used a LinkedList<string> it wouldnt use too much memory generating millions of strings?
Aug 15 '08 #8
cloud255
427 Expert 256MB
So if I used a LinkedList<string> it wouldnt use too much memory generating millions of strings?
yeah kind of, that depends if you implement your own linked list it might.
The microsoft implementation SHOULD be built to dynamically assign memory so it would only use as much as it needs.

If it is millions of strings, have a fixed size collection of like 1000 or whatever and write to your file everytime it is full.

If you have that many instances it doesn't matter what datastructure you use, it will cost a lot of memory.
Aug 15 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Linus Nikander | last post by:
Having recently load-tested the application we are developing I noticed that one of the most expensive (time-wise) calls was my fetch of a db-connection from the defined db-pool. At present I fetch...
0
by: R U B'n | last post by:
Hi everyone, I have to make a (case-insensitive) search from a form with only one search string, e.g. "Doe Peters english California", which will search in several fields of my table for each...
2
by: Belmin | last post by:
Hi all, Wanted to know what is the most efficient way of doing a select query for mysql that only returns one value. For example: $mysqli->query('select count(*) from log'); $temprec =...
15
by: Tor Erik Sønvisen | last post by:
Hi I need a time and space efficient way of storing up to 6 million bits. Time efficency is more important then space efficency as I'm going to do searches through the bit-set. regards tores
2
by: Jim Kitterman | last post by:
I am looking for the most efficient way of searching a large xml document (> 14mg). If I could get some pointers in the right direction. I am using VB.NET. It is readonly.
6
by: JezB | last post by:
What is the most efficient way to scan an array for a match ? I could just iterate directly through it comparing each array entry with what I am looking for, I could use an enumerator to do the...
1
by: Al | last post by:
Hi, I need to store literally thousands if images and scanned document in the Database. I would like to know what is the most efficient algorithm both in terms of speed and storage for saving images...
1
by: cwertman | last post by:
I have a document like so (Its actually a serilization of an Object) <Person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">...
1
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
Using .NET 2.0 is it more efficient to copy files to a single folder versus spreading them across multiple folders. For instance if we have 100,000 files to be copied, Do we copy all of them to...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.