473,657 Members | 2,624 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

15 New Member
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 3835
r035198x
13,262 MVP
Where did you hear that ArrayList is note efficient?
Aug 15 '08 #2
secutos
15 New Member
around the web. anybody have an answer?
Aug 15 '08 #3
cloud255
427 Recognized Expert Contributor
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 Recognized Expert Expert
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 Recognized Expert Contributor
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 Recognized Expert Expert
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<stri ng>
Aug 15 '08 #7
secutos
15 New Member
So if I used a LinkedList<stri ng> it wouldnt use too much memory generating millions of strings?
Aug 15 '08 #8
cloud255
427 Recognized Expert Contributor
So if I used a LinkedList<stri ng> 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
6115
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 my connections using : private Connection getConnection() throws SQLException { try { Context jndiCntx = new InitialContext(); DataSource ds = (DataSource)
0
2177
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 word. My fields that are searchable by this query are: nr smallint(5) company varchar(100) lastname(100)
2
3879
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 = $result->fetch_assoc(); $count = $temprec; That doesn't seem efficient. How should I do it? Or is this as efficient
15
2325
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
2310
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
2059
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 same thing (though I dont know if this is better), I could convert the array to some other structure which makes direct lookup possible (if I want to do the same thing many times), or maybe some other entirely different approach is better. Any ideas?
1
1880
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 in database (using SQL server). Currently I am using the following algorithms. Question is can I improve this? 'Get length of stream (lengt of file) in bytes InByteCount = loFile.Length() 'Reallocate storage space for an array variable to...
1
1497
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"> <BirthDate>8/31/1971</BirthDate> <CurrentEmployer>NSA</CurrentEmployer> <Kids> <Person> <BirthDate>8/31/1981</BirthDate> <CurrentEmployer>NSA</CurrentEmployer>
1
3882
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 a single folder called 'All Files' Do we spread them out and copy them to multiple folders like Folder 000 - Copy files from 0 to 1000 Folder 001 - Copy files from 1000 to 2000 Folder 002 - Copy files from 2000 to 2999
0
8427
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8850
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8746
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8523
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8626
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7355
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4334
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.