Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7070101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:31:32+00:00 2026-05-28T05:31:32+00:00

I am looking for a trie implementation for .net. I am planning to use

  • 0

I am looking for a trie implementation for .net.

I am planning to use it as the index structure for my in-memory object pool. It need not be thread safe (as only one thread will be updating it) but should be able to cope with at least 20 million items gracefully and with constant performance.

The ones I found on the net seems to be sample code or toy projects. So, I am really looking for a production quality implementation. Commercial libraries are also OK, if available.

PS:I selected tries as it seems hash table implementations that I have seen use too much memory and tend to cause memory fragmentations as they are based on arrays. Any such container with O(1) lookup characteristics and benign memory usage characteristics for large number of items could also be OK.

Thank you,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:31:33+00:00Added an answer on May 28, 2026 at 5:31 am

    In my personal opinion attempting to second-guess .Net’s own memory management is not a practise I’d recommend. You simply can’t exert the level of control over memory allocation that you can in a native scenario, but equally you shouldn’t need to. I was obsessed by a desire to do this when I first moved from C++ (where I would regularly work with my own heaps and write memory-localisation routines etc), but it swiftly became apparent that I just didn’t need to, nor could I.

    For example, you could have an array of MyPooledObject at the bottom of your trie, but, if that is a reference type, then you’ve just got an array of references, where the actual memory for each is somewhere else – that you can’t control (unless you adapt your own host for the runtime).

    That leaves using a value-type instead – but these are simply not suitable for use in a pooled scenario, because custom value types should be immutable (I can say that safely without justifying it – just google ‘immutable’ and ‘struct’ targetting site:stackoverflow.com to see more) and therefore no good to be treated as reusable objects.

    If you need an indexed collection of objects in .Net where each is recognisable with a hash-capable key, then use a Dictionary.

    If you have too many objects to fit in memory then either:

    1) Get more memory

    2) Use a database and cache local segments of it

    Or both: You could consider looking at AppFabric and its cache features, that way you can build a farm of machines dedicated to running in-memory caches of millions of objects. The cost of the hardware will probably be less than the cost of developing your own memory management solution for .Net 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Looking for an structure of how to build a group inside pool of a
Possible Duplicate: Where do I find a standard Trie based map implementation in Java?
I need to write an efficient algorithm for looking up words with missing letters
Looking a solution for strange JTDS error message: Could not find a Java charset
Looking through the Django docs and trying to figure out the use of the
Looking to replace a ZIRE31 Palm device I need a PalmReader equivalent for Android.
Looking at the missing index DMVs on SQLServer it suggests I add the following
Looking for a way to not have a publicly hosted video be used in
I am looking to implement a VBA trie -building algorithm that is able to
Looking for simple php class routing, like this: http://fatfree.sourceforge.net/page/routing-engine Is there a ready-made solutions?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.