Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some cpp<->chai performance tests
- Loading branch information
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include <chaiscript/chaiscript.hpp> | ||
#include <chaiscript/chaiscript_stdlib.hpp> | ||
|
||
double f(const std::string &, double, bool) noexcept { | ||
return .0; | ||
} | ||
|
||
int main() | ||
{ | ||
chaiscript::ChaiScript chai(chaiscript::Std_Lib::library()); | ||
|
||
chai.add(chaiscript::fun(&f), "f"); | ||
|
||
chai.eval(R"( | ||
for (var i = 0; i < 100000; ++i) { | ||
f("str", 1.2, false); | ||
} | ||
)"); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include <chaiscript/chaiscript.hpp> | ||
#include <chaiscript/chaiscript_stdlib.hpp> | ||
|
||
double f(const std::string &, double, bool) noexcept { | ||
return .0; | ||
} | ||
|
||
int main() | ||
{ | ||
chaiscript::ChaiScript chai(chaiscript::Std_Lib::library()); | ||
|
||
chai.add(chaiscript::fun(&f), "f"); | ||
|
||
const auto f = chai.eval<std::function<void ()>>(R"(fun(){ f("str", 1.2, false); })"); | ||
|
||
for (int i = 0; i < 100000; ++i) { | ||
f(); | ||
} | ||
|
||
} |
e082763
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e082763
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
release-5.x (lefticus) - x86_64-Linux-Ubuntu-14.04-clang-3.5: OK (397 of 397 tests passed, 0 test warnings)
e082763
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
release-5.x (lefticus) - x86_64-Linux-Ubuntu-14.04-clang-3.5-LibC++: OK (389 of 389 tests passed, 0 test warnings)
e082763
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
release-5.x (lefticus) - i386-Windows-10-VisualStudio-14: OK (388 of 389 tests passed, 0 test warnings)
e082763
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
release-5.x (lefticus) - Win64-Windows-10-VisualStudio-14: OK (388 of 389 tests passed, 0 test warnings)
e082763
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
release-5.x (lefticus) - x86_64-Linux-Ubuntu-14.04-clang-3.6-AddressSanitizer: OK (3047 of 3047 tests passed, 0 test warnings)
e082763
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
release-5.x (lefticus) - i386-Windows-10-VisualStudio-12: OK (388 of 389 tests passed, 0 test warnings)
e082763
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
release-5.x (lefticus) - x86_64-Linux-Ubuntu-14.04-clang-3.6-ThreadSanitizer: OK (389 of 389 tests passed, 0 test warnings)
e082763
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
release-5.x (lefticus) - Win64-Windows-10-VisualStudio-12: OK (388 of 389 tests passed, 0 test warnings)
e082763
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
release-5.x (lefticus) - x86_64-Linux-Ubuntu-14.04-gcc-4.8-NoThreads: OK (393 of 396 tests passed, 0 test warnings)
e082763
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
release-5.x (lefticus) - x86_64-Linux-Ubuntu-14.04-gcc-4.8: OK (397 of 397 tests passed, 0 test warnings)
e082763
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
release-5.x (lefticus) - x86_64-Linux-Ubuntu-14.04-gcc-4.6: OK (397 of 397 tests passed, 0 test warnings)
e082763
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
release-5.x (lefticus) - x86_64-Linux-Ubuntu-14.04-cppcheck-1.61: OK (0 of 0 tests passed, 0 test warnings)
e082763
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
release-5.x (lefticus) - x86_64-Linux-Ubuntu-14.04-custom_check: OK (0 of 0 tests passed, 0 test warnings)
e082763
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
release-5.x (lefticus) - x86_64-MacOS-10.9-clang: OK (389 of 389 tests passed, 0 test warnings)
e082763
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
release-5.x (lefticus) - x86_64-MacOS-10.9-clang-Debug: OK (389 of 389 tests passed, 0 test warnings)