Skip to content

Commit 3b4442b

Browse files
author
rafalh
committed
Add bigarray in benchamrk
1 parent c59cbb1 commit 3b4442b

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

samples/today/TodayMock.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,17 @@ std::optional<std::vector<std::shared_ptr<object::AppointmentEdge>>> Appointment
229229
return result;
230230
}
231231

232+
std::vector<double> AppointmentConnection::getBigArray() const noexcept
233+
{
234+
std::vector<double> ret(1000);
235+
int i = 0;
236+
for (auto& r : ret)
237+
{
238+
r = i++;
239+
}
240+
return ret;
241+
}
242+
232243
Task::Task(response::IdType&& id, std::string&& title, bool isComplete)
233244
: _id(std::move(id))
234245
, _title(std::make_shared<response::Value>(std::move(title)))

samples/today/TodayMock.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ class AppointmentConnection
174174

175175
std::shared_ptr<object::PageInfo> getPageInfo() const noexcept;
176176
std::optional<std::vector<std::shared_ptr<object::AppointmentEdge>>> getEdges() const noexcept;
177+
std::vector<double> getBigArray() const noexcept;
177178

178179
private:
179180
std::shared_ptr<PageInfo> _pageInfo;

samples/today/benchmark.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ int main(int argc, char** argv)
106106
isNow
107107
}
108108
}
109+
bigArray
109110
}
110111
})gql"sv);
111112
const auto startValidate = std::chrono::steady_clock::now();
@@ -143,7 +144,7 @@ int main(int argc, char** argv)
143144

144145

145146

146-
if (1)
147+
if (0)
147148
{
148149
auto resolverResult = service->visit({ query }).get();
149150
startToJson = std::chrono::steady_clock::now();

samples/today/schema.today.graphql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ type AppointmentEdge {
6262
type AppointmentConnection {
6363
pageInfo: PageInfo!
6464
edges: [AppointmentEdge]
65+
bigArray: [Float!]!
6566
}
6667

6768
type TaskEdge {

0 commit comments

Comments
 (0)