Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bench/vm #454

Merged
merged 7 commits into from
Apr 19, 2024
Merged

Bench/vm #454

merged 7 commits into from
Apr 19, 2024

Conversation

SuperFola
Copy link
Member

Description

Adding benchmarks for the virtual machine

Checklist

  • I have read the Contributor guide
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation if needed
  • I have added tests that prove my fix/feature is working
  • New and existing tests pass locally with my changes

Copy link

github-actions bot commented Apr 17, 2024

Static analysis report

Lizard report

Listing only functions with cyclomatic complexity >= 15 or NLOC >= 100 or parameters >= 6.

Filename Start line:end line Function name Parameters NLOC CCN
Report about files you didn't modify in this PR
Filename Start line:end line Function name Parameters NLOC CCN
./src/arkreactor/VM/VM.cpp 258:1153 Ark::VM::safeRun 2 644 165
./src/arkreactor/Compiler/BytecodeReader.cpp 70:438 Ark::BytecodeReader::display 4 327 131
./src/arkreactor/Compiler/Macros/Processor.cpp 219:463 Ark::internal::MacroProcessor::evaluate 2 206 72
./include/Ark/Compiler/AST/Parser.hpp 78:169 Ark::internal::ARK_APIParser::string 0 89 34
./src/arkscript/main.cpp 17:310 main 2 252 31
./src/arkreactor/Compiler/Compiler.cpp 530:635 Ark::Compiler::handleCalls 5 78 27
./src/arkreactor/Compiler/Compiler.cpp 261:352 Ark::Compiler::compileExpression 5 74 24
./src/arkreactor/Compiler/AST/Node.cpp 209:279 Ark::internal::operator < < 2 61 23
./src/arkscript/JsonCompiler.cpp 23:188 JsonCompiler::_compile 1 139 23
./src/arkreactor/VM/State.cpp 148:288 Ark::State::configure 0 116 22
./include/utf8.hpp 137:183 utf8::isValid 1 44 21
./src/arkreactor/Compiler/Macros/Processor.cpp 121:185 Ark::internal::MacroProcessor::processNode 2 48 20
./src/arkreactor/Compiler/AST/Parser.cpp 278:388 Ark::internal::Parser::import_ 0 89 19
./src/arkreactor/Compiler/Macros/Executors/Function.cpp 12:87 Ark::internal::FunctionExecutor::applyMacro 1 61 18
./src/arkreactor/Compiler/AST/Node.cpp 143:207 Ark::internal::Node::repr 0 56 17
./src/arkreactor/VM/Value.cpp 146:225 Ark::Value::toString 2 67 17
./include/Ark/Compiler/AST/Predicates.hpp 162:186 Ark::internal::IsSymbol::operator ( ) 1 24 16
./src/arkreactor/Compiler/Macros/Processor.cpp 53:101 Ark::internal::MacroProcessor::registerMacro 1 44 16
./src/arkscript/REPL/Repl.cpp 14:106 Ark::Repl::run 0 74 16
./src/arkreactor/TypeChecker.cpp 27:78 Ark::types::displayContract 2 45 15
./src/arkscript/Formatter.cpp 117:170 Formatter::format 3 51 15
./src/arkreactor/Exceptions.cpp 123:132 Ark::Diagnostics::helper 8 9 3
./include/Ark/Exceptions.hpp 109:118 Ark::CodeError::CodeError 6 10 1

CppCheck report

Filename Line Type Description
include/Ark/Compiler/AST/Optimizer.hpp 64 style Unused private function 'Optimizer throwOptimizerError'
include/Ark/Compiler/AST/Parser.hpp 173 style Local variable 'symbol' shadows outer function
include/Ark/Compiler/AST/Predicates.hpp 117 performance Function parameter 'c' should be passed by const reference.
include/Ark/Compiler/AST/utf8_char.hpp 29 style Local variable 'codepoint' shadows outer function
include/Ark/TypeChecker.hpp 71 performance Function parameter 'name' should be passed by const reference.
include/Ark/TypeChecker.hpp 75 performance Function parameter 'name' should be passed by const reference.
include/Ark/VM/inline/VM.inl 272 style Unused variable _
include/CLI/Formatter.hpp 39 style Unused private function 'Formatter isPlainValue'
include/utf8.hpp 37 style Local variable 'codepoint' shadows outer function
src/arkreactor/Builtins/IO.cpp 192 style Consider using std transform algorithm instead of a raw loop.
src/arkreactor/Compiler/AST/BaseParser.cpp 311 style Consider using std any_of algorithm instead of a raw loop.
src/arkreactor/Compiler/AST/BaseParser.cpp 351 style Consider using std any_of algorithm instead of a raw loop.
src/arkreactor/Compiler/AST/Optimizer.cpp 38 style Parameter 'node' can be declared with const
src/arkreactor/Compiler/AST/Optimizer.cpp 44 style Parameter 'node' can be declared with const
src/arkreactor/Compiler/AST/Parser.cpp 832 style Consider using std any_of algorithm instead of a raw loop.
src/arkreactor/Compiler/Compiler.cpp 138 style Consider using std copy algorithm instead of a raw loop.
src/arkreactor/Compiler/Compiler.cpp 158 style Consider using std copy algorithm instead of a raw loop.
src/arkreactor/Compiler/Compiler.cpp 165 style Consider using std copy algorithm instead of a raw loop.
src/arkreactor/Compiler/ImportSolver.cpp 141 style Consider using std transform algorithm instead of a raw loop.
src/arkreactor/Compiler/Macros/Executors/Function.cpp 50 performance Searching before insertion is not necessary. Instead of 'args_applied[arg_name]=Node(NodeType List)' consider using 'args_applied.try_emplace(arg_name, Node(NodeType List));'.
src/arkreactor/Compiler/Macros/Processor.cpp 103 style Parameter 'node' can be declared with const
src/arkreactor/Compiler/Macros/Processor.cpp 123 style The scope of the variable 'has_created' can be reduced.
src/arkreactor/TypeChecker.cpp 80 performance Function parameter 'funcname' should be passed by const reference.
src/arkreactor/VM/Future.cpp 10 performance Variable 'm_value' is assigned in constructor body. Consider performing initialization in initialization list.
src/arkreactor/VM/State.cpp 125 style Consider using std transform algorithm instead of a raw loop.
src/arkreactor/VM/VM.cpp 637 style Consider using std copy algorithm instead of a raw loop.
src/arkreactor/VM/Value.cpp 43 performance Variable 'm_value' is assigned in constructor body. Consider performing initialization in initialization list.
src/arkscript/Formatter.cpp 225 style The scope of the variable 'comment_in_args' can be reduced.
src/arkscript/Formatter.cpp 446 warning Either the condition 'node.constList().empty()' is redundant or expression 'node.constList().back()' cause access out of bounds.
src/arkscript/main.cpp 141 style Consider using std copy algorithm instead of a raw loop.
src/arkscript/main.cpp 148 style Consider using std copy algorithm instead of a raw loop.

…n and code refactoring

This will be used to avoid any performance regression, running as often as I can
on my personal computer and/or server (a CI can't be trusted with the kind of
accuracy I'm seeking here ; even though the relative benchmarks are running on a
CI it's fine here because we are only looking at the difference between ArkScript
and other languages (whose versions are fixed)).
@SuperFola SuperFola force-pushed the bench/vm branch 2 times, most recently from 3bd259f to e180f33 Compare April 17, 2024 20:41
@SuperFola SuperFola merged commit 563cafa into dev Apr 19, 2024
16 checks passed
@SuperFola SuperFola deleted the bench/vm branch April 19, 2024 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant