mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 22:28:45 +01:00
Add a benchmark to test the Wren C API.
I've got some ideas on how to tweak the embedding API, but I want to see what performance impact they have first, so this adds a little benchmark that just calls a foreign method a ton of times.
This commit is contained in:
@ -39,13 +39,13 @@ static void returnBytes(WrenVM* vm)
|
||||
|
||||
WrenForeignMethodFn returnsBindMethod(const char* signature)
|
||||
{
|
||||
if (strcmp(signature, "static Api.implicitNull") == 0) return implicitNull;
|
||||
if (strcmp(signature, "static Api.returnInt") == 0) return returnInt;
|
||||
if (strcmp(signature, "static Api.returnFloat") == 0) return returnFloat;
|
||||
if (strcmp(signature, "static Api.returnTrue") == 0) return returnTrue;
|
||||
if (strcmp(signature, "static Api.returnFalse") == 0) return returnFalse;
|
||||
if (strcmp(signature, "static Api.returnString") == 0) return returnString;
|
||||
if (strcmp(signature, "static Api.returnBytes") == 0) return returnBytes;
|
||||
if (strcmp(signature, "static Returns.implicitNull") == 0) return implicitNull;
|
||||
if (strcmp(signature, "static Returns.returnInt") == 0) return returnInt;
|
||||
if (strcmp(signature, "static Returns.returnFloat") == 0) return returnFloat;
|
||||
if (strcmp(signature, "static Returns.returnTrue") == 0) return returnTrue;
|
||||
if (strcmp(signature, "static Returns.returnFalse") == 0) return returnFalse;
|
||||
if (strcmp(signature, "static Returns.returnString") == 0) return returnString;
|
||||
if (strcmp(signature, "static Returns.returnBytes") == 0) return returnBytes;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user