> On March 11, 2014, 4:52 p.m., Dominic Hamon wrote: > > src/state/log.cpp, line 454 > > <https://reviews.apache.org/r/19007/diff/1/?file=515951#file515951line454> > > > > const hashset<string>& keys = snapshots.keys(); > > return vector<string>(keys.begin(), keys.end()); > > > > might be shorter and more efficient.
FWIW it's what I did in the InMemoryStorage: https://github.com/apache/mesos/blob/master/src/state/in_memory.cpp#L63 Not sure about your efficiency comment, since the alternative code has to generate a hashset of all the keys before constructing the vector, probably best to ignore the efficiency comparison for now. :) > On March 11, 2014, 4:52 p.m., Dominic Hamon wrote: > > src/state/log.cpp, line 87 > > <https://reviews.apache.org/r/19007/diff/1/?file=515951#file515951line87> > > > > why list over vector? vector is going to be more cache friendly even if > > you don't need random access. It's because list is being returned by the underlying Log::Reader API. - Ben ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/19007/#review36798 ----------------------------------------------------------- On March 11, 2014, 2:53 a.m., Benjamin Hindman wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/19007/ > ----------------------------------------------------------- > > (Updated March 11, 2014, 2:53 a.m.) > > > Review request for mesos, Ben Mahler and Jie Yu. > > > Repository: mesos-git > > > Description > ------- > > This is a combination of both https://reviews.apache.org/r/17423 and > https://reviews.apache.org/r/17424 which have been merged to make it easier > to make changes. > > > Diffs > ----- > > src/Makefile.am 384b3122b61294401ba4a894c06e985d9fc2fb1e > src/messages/state.proto 7f7a8a505d6f24b01fec0c3ad47b0e15b2b17ffa > src/state/log.hpp PRE-CREATION > src/state/log.cpp PRE-CREATION > src/tests/log_tests.cpp b368cdec6a81a8ddeb6fc14d4723a09797a6b0a1 > src/tests/state_tests.cpp bc6c91439a50e7b93077f5b1e66b0419860cb35b > > Diff: https://reviews.apache.org/r/19007/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Benjamin Hindman > >
