octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #49559] Implementation of containers.Map


From: Rik
Subject: [Octave-bug-tracker] [bug #49559] Implementation of containers.Map
Date: Thu, 1 Dec 2016 18:41:22 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Update of bug #49559 (project octave):

                  Status:                    None => Patch Submitted        

    _______________________________________________________

Follow-up Comment #2:

I took a look at your implementation.  I do think we need to have a map/hash
structure available in Octave.  However, I think it should be based on structs
which internally use std::set and are quite fast.  I did some benchmarking
which shows that a struct implementation would be 500X faster.


vals = num2cell ([1:100]');
keys = cellfun (@(x) sprintf ("%d", x), vals, "unif", false);

map = Map (keys, vals)
containers.Map object with properties:

   Count     : 100
   KeyType   : char
   ValueType : double

tic; map("50"); toc
Elapsed time is 0.0261769 seconds.

for i = 1:100
> smap.(keys{i}) = vals{i};
> endfor

tic; smap.("50"); toc
Elapsed time is 5.19753e-05 seconds.

.026 / 5e-5
ans =  520


Would you be interested in making the necessary changes?  I seem to recall
that we still haven't sorted out a copyright assignment for you due to
concerns over remaining anonymous.  If you want, I can take over from here and
modify the code and use my name on the copyright.  Or we can work with Mike
Miller or someone at the FSF to figure out the licensing situation.



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?49559>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]