Hi
What are your key/value types? Are you using anonymous value types eg, { file:String, line:Int } or a class/int or something else?
Hugh
I actually got the implementation from the internet and have not tried high-stress tests on it.
One possibility for string keys is that neko might hash the strings, and then do integer compares. This would have the performance profile you describe - slower with fewer items, and then faster with more.
Looks like it is worth running a profiler over it to see if there is anything that can be done easily to speed it up.
Hugh
The problem with std::map is that it allocates memory for the nodes, which would need to be freed in some kind of finalizer. However, there is an overhead with finalizes, so I was not keen on this approach. It might be possible to make it work with a custom allocator though that uses the GC alloc.
The code is well-defined and relatively small, so it should be easy to try alternate implementations. Possibly even switching implementations once the map hits a certain size (eg, for small object, a linear map, then move to current implementation until 10000 or whatever, then hash the string values). I'm happy to look at any evidence in this area.
--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.