2009/10/27 psant...@codicesoftware.com psant...@codicesoftware.com:
Hi,
If you need to store key/value pairs, where the key will be ALWAYS a
unique long (no collisions), is there anything better than a Hashtable?
Thanks
pablo
Presumably, though, the key can span the entire range of
If the key is random, a hashtable is the fastest way. You may be able to eke
some extra speed out of the DictionaryK, V class by ripping all the code
to support generic keys and instead hardcode the key to always be a long.
That should save a bit of time, though whether it'd be noticable or not I
If you know your input set and can design a hash function that is
guaranteed to never give collisions for that input set, you could
perhaps gain something by implementing a hash table that ignores the
risk of collisions.
/Oskar
2009/10/28 Alan McGovern alan.mcgov...@gmail.com:
If the key is
Thanks,
Good to know! I'll give it a try.
Alan McGovern wrote:
If the key is random, a hashtable is the fastest way. You may be able to
eke some extra speed out of the DictionaryK, V class by ripping all
the code to support generic keys and instead hardcode the key to always
be a long. That
On Tue, Oct 27, 2009 at 11:58:31PM +0100, psant...@codicesoftware.com wrote:
If you need to store key/value pairs, where the key will be ALWAYS a
unique long (no collisions), is there anything better than a Hashtable?
There are always Judy arrays, see http://judy.sourceforge.net/.
--
Felipe.
Excellent. Is there a wrapper for C#? Is it worth?
Felipe Lessa wrote:
On Tue, Oct 27, 2009 at 11:58:31PM +0100, psant...@codicesoftware.com wrote:
If you need to store key/value pairs, where the key will be ALWAYS a
unique long (no collisions), is there anything better than a Hashtable?
Really what you need to do is benchmark all of the different options using
your expected workload. It's near useless us telling you X is faster or Y is
better without knowing the workload involved.
Alan.
On Wed, Oct 28, 2009 at 2:40 PM, pablosantosl...@terra.es
pablosantosl...@terra.es wrote:
On Wed, Oct 28, 2009 at 12:40 PM, pablosantosl...@terra.es
pablosantosl...@terra.es wrote:
Excellent. Is there a wrapper for C#? Is it worth?
Not that I know of, however it shouldn't be hard to create one.
--
Felipe.
___
Mono-devel-list mailing list
Sure Alan!
So, basically, the options are:
- Use a sorted ArrayList and a binary search
- Reimplement hashtable focusing on long keys
- Write a wrapper to Judy
Alan McGovern wrote:
Really what you need to do is benchmark all of the different options
using your expected workload. It's near
Hey,
On Wed, Oct 28, 2009 at 4:30 PM, pablosantosl...@terra.es
pablosantosl...@terra.es wrote:
Sure Alan!
So, basically, the options are:
- Use a sorted ArrayList and a binary search
For this option the same story applies as for Dictionary K,V. If you write
a strongly typed sorted list
As p/invokes cost a lot, another (fourth) option would be to
reimplement judy arrays algorithm (which I admittedly know nearly
nothing about) in managed code. From reading their 10 minutes intro, I
guess some of the cache-fill optimizations it implements may be
jeopardized by the JIT workings, but
Hi all,
Is System.Drawing by any means thread-safe?
Can I create some threads, create a Graphics object in each of them and
then work with it from within that thread? Is this supposed to work or
am I doing something really stupid here?
I ask because I've noticed random crashes in a
Alex Shulgin wrote:
Hi all,
Is System.Drawing by any means thread-safe?
Can I create some threads, create a Graphics object in each of them and
then work with it from within that thread? Is this supposed to work or
am I doing something really stupid here?
Oh, forgot to mention that
On Wed, 2009-10-28 at 19:37 +0200, Alex Shulgin wrote:
Hi all,
Is System.Drawing by any means thread-safe?
No, like most of the .net framework, i.e.
quoteAny public static (Shared in Visual Basic) members of
this type are thread safe. Any instance members are not
On Wed, 2009-10-28 at 19:47 +0200, Alex Shulgin wrote:
Alex Shulgin wrote:
Hi all,
Is System.Drawing by any means thread-safe?
Can I create some threads, create a Graphics object in each of them and
then work with it from within that thread? Is this supposed to work or
am I
Hello,
It is thread safe for instances of objects, but you can not mix
objects that need to interact with the windowing system with calls
made in separate threads.
The simple solution is to make sure that anything that interacts
with the GUI uses Control.Invoke.
On Oct 28, 2009,
16 matches
Mail list logo