aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2013-05-06 17:54:10 +0300
committerChad Austin <chad@imvu.com>2013-05-17 12:57:24 -0700
commitfd62cafc529c0b8da9159df1c65af5d03a5bf41d (patch)
treeb3977ce7166fe5a8254f831ac33ae208769c1e5d /tests
parent259c1062644c7cf660ab34df3d7468c6904bb1da (diff)
Pre-register symbol strings in embind benchmark just to be sure - e.g. Uint8Array was not found via 'fast path', but with slow string compares!
Diffstat (limited to 'tests')
-rw-r--r--tests/embind/embind_benchmark.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/embind/embind_benchmark.cpp b/tests/embind/embind_benchmark.cpp
index 5ad41654..d6aa950f 100644
--- a/tests/embind/embind_benchmark.cpp
+++ b/tests/embind/embind_benchmark.cpp
@@ -143,23 +143,29 @@ public:
EMSCRIPTEN_SYMBOL(HEAP8);
EMSCRIPTEN_SYMBOL(buffer);
+EMSCRIPTEN_SYMBOL(call0);
+EMSCRIPTEN_SYMBOL(call1);
+EMSCRIPTEN_SYMBOL(call_with_typed_array);
+EMSCRIPTEN_SYMBOL(call_with_memory_view);
+EMSCRIPTEN_SYMBOL(Uint8Array);
+
class InterfaceWrapper : public emscripten::wrapper<Interface>
{
public:
EMSCRIPTEN_WRAPPER(InterfaceWrapper);
void call0() override {
- return call<void>("call0");
+ return call<void>(call0_symbol);
}
std::wstring call1(const std::wstring& str1, const std::wstring& str2) {
- return call<std::wstring>("call1", str1, str2);
+ return call<std::wstring>(call1_symbol, str1, str2);
}
void call_with_typed_array(size_t size, const void* data) {
return call<void>(
- "call_with_typed_array",
- emscripten::val::global("Uint8Array").new_(
+ call_with_typed_array_symbol,
+ emscripten::val::global(Uint8Array_symbol).new_(
emscripten::val::module_property(HEAP8_symbol)[buffer_symbol],
reinterpret_cast<uintptr_t>(data),
size));
@@ -167,7 +173,7 @@ public:
void call_with_memory_view(size_t size, const void* data) {
return call<void>(
- "call_with_memory_view",
+ call_with_memory_view_symbol,
emscripten::memory_view(size, data));
}
};