Comparing version 0.9.27 to 0.9.28
@@ -19,4 +19,7 @@ # This program is free software: you can redistribute it and/or modify | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD 20) | ||
set(THREADS_PREFER_PTHREAD_FLAG ON) | ||
find_package(Threads REQUIRED) | ||
if(NOT TARGET koffi) | ||
@@ -31,2 +34,3 @@ add_subdirectory(.. koffi) | ||
target_include_directories(atoi_cc PRIVATE ..) | ||
target_link_libraries(atoi_cc PRIVATE Threads::Threads) | ||
@@ -40,2 +44,3 @@ if(WIN32) | ||
target_include_directories(atoi_napi PRIVATE .. ../vendor/node-addon-api) | ||
target_link_libraries(atoi_napi PRIVATE Threads::Threads) | ||
@@ -45,2 +50,4 @@ if(WIN32) | ||
target_link_libraries(atoi_napi PRIVATE ws2_32) | ||
else() | ||
target_link_libraries(atoi_napi PRIVATE dl) | ||
endif() | ||
@@ -50,5 +57,5 @@ | ||
add_executable(raylib_cc atoi_cc.cc ../vendor/libcc/libcc.cc) | ||
add_executable(raylib_cc raylib_cc.cc ../vendor/libcc/libcc.cc) | ||
target_include_directories(raylib_cc PRIVATE ..) | ||
add_dependencies(raylib_cc raylib) | ||
target_link_libraries(raylib_cc PRIVATE Threads::Threads raylib) | ||
@@ -58,2 +65,4 @@ if(WIN32) | ||
target_link_libraries(raylib_cc PRIVATE ws2_32) | ||
else() | ||
target_link_libraries(raylib_cc PRIVATE dl) | ||
endif() |
@@ -85,3 +85,3 @@ #!/usr/bin/env node | ||
let lib_filename = path.dirname(__filename) + '/test/build/raylib' + koffi.extension; | ||
let lib_filename = path.dirname(__filename) + '/build/raylib' + koffi.extension; | ||
let lib = koffi.load(lib_filename); | ||
@@ -88,0 +88,0 @@ |
@@ -101,11 +101,4 @@ #!/usr/bin/env node | ||
let iterations = parseInt(process.argv[2], 10); | ||
if (Number.isNaN(iterations)) | ||
throw new Error('Not a valid number'); | ||
if (iterations < 1) | ||
throw new Error('Value must be positive'); | ||
console.log('Iterations:', iterations); | ||
let lib_filename = path.dirname(__filename) + '/build/raylib' + koffi.extension; | ||
let lib_filename = path.dirname(__filename) + '/test/build/raylib' + koffi.extension; | ||
const r = ffi.Library(lib_filename, { | ||
@@ -112,0 +105,0 @@ InitWindow: ['void', ['int', 'int', 'string']], |
{ | ||
"name": "koffi", | ||
"version": "0.9.27", | ||
"version": "0.9.28", | ||
"description": "Fast and simple FFI (foreign function interface) for Node.js", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -268,3 +268,3 @@ # Table of contents | ||
Here are some results from 2022-04-24 on my Linux machine (AMD® Ryzen™ 7 5800H 16G): | ||
Here are some results from 2022-04-24 on Linux on my machine (AMD® Ryzen™ 7 5800H 16G): | ||
@@ -282,3 +282,3 @@ ```sh | ||
Iterations: 20000000 | ||
Time: 2.34s | ||
Time: 1.91s | ||
@@ -294,3 +294,3 @@ # Note: the Node-FFI version does a few setTimeout calls to force the GC to run (around 20 | ||
And on my Windows machine (Intel® Core™ i5-4460 16G): | ||
And on Windows on the same machine (AMD® Ryzen™ 7 5800H 16G): | ||
@@ -300,15 +300,15 @@ ```sh | ||
Iterations: 20000000 | ||
Time: 0.66s | ||
Time: 0.25s | ||
$ node atoi_napi.js | ||
Iterations: 20000000 | ||
Time: 3.23s | ||
Time: 1.94s | ||
$ node atoi_koffi.js | ||
Iterations: 20000000 | ||
Time: 4.81s | ||
Time: 3.15s | ||
$ node atoi_node_ffi.js | ||
Iterations: 20000000 | ||
Time: 491.99s | ||
Time: 267.20s | ||
``` | ||
@@ -318,3 +318,3 @@ | ||
Here are some results from 2022-04-24 on my Linux machine (AMD® Ryzen™ 7 5800H 16G): | ||
Here are some results from 2022-04-24 on Linux on my machine (AMD® Ryzen™ 7 5800H 16G): | ||
@@ -335,3 +335,3 @@ ```sh | ||
And on my Windows machine (Intel® Core™ i5-4460 16G): | ||
And on Windows on the same machine (AMD® Ryzen™ 7 5800H 16G): | ||
@@ -341,11 +341,11 @@ ```sh | ||
Iterations: 100 | ||
Time: 10.53s | ||
Time: 8.39s | ||
$ node raylib_koffi.js | ||
Iterations: 100 | ||
Time: 14.60s | ||
Time: 11.51s | ||
$ node raylib_node_ffi.js | ||
Iterations: 100 | ||
Time: 44.97s | ||
Time: 32.47s | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67730543
12933