Merge lp:~zorba-coders/zorba/msb-misc into lp:zorba

Proposed by Matthias Brantner
Status: Merged
Approved by: Markos Zaharioudakis
Approved revision: no longer in the source branch.
Merged at revision: 11283
Proposed branch: lp:~zorba-coders/zorba/msb-misc
Merge into: lp:zorba
Diff against target: 50 lines (+10/-9)
2 files modified
src/store/naive/json_items.h (+5/-0)
src/store/naive/simple_item_factory.cpp (+5/-9)
To merge this branch: bzr merge lp:~zorba-coders/zorba/msb-misc
Reviewer Review Type Date Requested Status
Markos Zaharioudakis Approve
Matthias Brantner Approve
Review via email: mp+152762@code.launchpad.net

Commit message

performance improvements for json array construction

To post a comment you must log in.
Revision history for this message
Matthias Brantner (matthias-brantner) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job msb-misc-2013-03-11T19-50-38.426Z is finished. The final status was:

All tests succeeded!

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1. Got: 1 Approve, 2 Pending.

lp:~zorba-coders/zorba/msb-misc updated
11282. By [u'Paul J. Lucas <email address hidden>']

Fixed warnings, mostly. Approved: Matthias Brantner, Paul J. Lucas

Revision history for this message
Markos Zaharioudakis (markos-za) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job msb-misc-2013-03-12T09-01-51.999Z is finished. The final status was:

All tests succeeded!

lp:~zorba-coders/zorba/msb-misc updated
11283. By [u'Matthias Brantner <matthias.brantner@28msec.com>']

performance improvements for json array construction Approved: Markos Zaharioudakis, Matthias Brantner

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/store/naive/json_items.h'
2--- src/store/naive/json_items.h 2013-02-26 04:12:43 +0000
3+++ src/store/naive/json_items.h 2013-03-11 19:47:36 +0000
4@@ -407,6 +407,11 @@
5 SimpleJSONArray()
6 {}
7
8+ SimpleJSONArray(size_t aReservedSize)
9+ {
10+ theContent.reserve(aReservedSize);
11+ }
12+
13 virtual ~SimpleJSONArray();
14
15 // store API
16
17=== modified file 'src/store/naive/simple_item_factory.cpp'
18--- src/store/naive/simple_item_factory.cpp 2013-03-07 10:10:10 +0000
19+++ src/store/naive/simple_item_factory.cpp 2013-03-11 19:47:36 +0000
20@@ -2172,13 +2172,13 @@
21 const std::vector<store::Iterator_t>& sources,
22 const std::vector<store::CopyMode>& copyModes)
23 {
24- result = new json::SimpleJSONArray();
25+ csize numSources = sources.size();
26+
27+ result = new json::SimpleJSONArray(numSources);
28
29 json::JSONArray* array = static_cast<json::JSONArray*>(result.getp());
30
31 store::Item_t item;
32-
33- csize numSources = sources.size();
34 for (csize i = 0; i < numSources; ++i)
35 {
36 store::Iterator* source = sources[i].getp();
37@@ -2233,12 +2233,8 @@
38
39 json::JSONArray* array = static_cast<json::JSONArray*>(result.getp());
40
41- std::vector<store::Item_t>::const_iterator ite = items.begin();
42- std::vector<store::Item_t>::const_iterator end = items.end();
43- for (; ite != end; ++ite)
44- {
45- array->push_back(*ite);
46- }
47+ array->push_back(items);
48+
49 return true;
50 }
51

Subscribers

People subscribed via source and target branches