Comments (5)
The actual monitoring algorithms for temporal logic operators are implemented in both C++ (rtamt/cpplib/stl/rtamt_stl_library) and Python (rtamt/operation/stl). Both implementations provide the same functionality. Either one or the other is dynamically loaded based on the is_pure_python flag in STLSpecification object (the default value is true, i.e. the pure Python version). We use Boost.Python to create Python wrappers around C++ objects (see (rtamt/cpplib/stl/rtamt_stl_library_wrapper).
The PyPi package currently contains both the source distribution and the binary wheel, i.e. C++ library is pre-compiled on an Ubuntu 16.04 distribution. Our first tests show no visible performance gains in the C++ implementation compared to its Python counterpart, but we need to study it more closely. In principle, we plan to keep both implementation and to have a PyPi package that automatically builds the C++ binaries from the source.
I suggest using the Python-only implementation for now, as we do not have yet visible evidence about the advantage of using the Python/C++ version.
from rtamt.
I hope it answers your questions, do not hesitate to ask for further clarifications.
from rtamt.
Thanks, that about covers it for now. I'm interested to hear more regarding the performance tests you ran -- were the specifications simple enough that the overhead of Python didn't make a measurable difference?
from rtamt.
I reran the performance tests, and now I am indeed able to measure the difference between the pure Python and the Python/C++ implementation - I must have done something wrong in my first evaluation.
There are one major source of complexity in STL monitors - the size of the temporal operator intervals (defining the number of samples that you need to process). I used the time library and recorded the time before and after making an update with time.time()). I used a simple STL formula (always[0:K] (a+b <= 2)) and varied K, and indeed there is a considerable difference between the pure Python and the Python/C++.
The difference starts getting noticeable for K >= 5000
K Python Python/C++
5k 0.009 0.0014
50k 0.2 0.008
500k 40 0.07
etc.
from rtamt.
I reran the performance tests, and now I am indeed able to measure the difference between the pure Python and the Python/C++ implementation - I must have done something wrong in my first evaluation.
There are one major source of complexity in STL monitors - the size of the temporal operator intervals (defining the number of samples that you need to process). I used the time library and recorded the time before and after making an update with time.time()). I used a simple STL formula (always[0:K] (a+b <= 2)) and varied K, and indeed there is a considerable difference between the pure Python and the Python/C++.
The difference starts getting noticeable for K >= 5000
K Python Python/C++
5k 0.009 0.0014
50k 0.2 0.008
500k 40 0.07
etc.
from rtamt.
Related Issues (20)
- Update ANTLR version HOT 5
- rtamt/tests/python/ast/test_ast_visitor.py HOT 1
- rtamt/tests/python/ast/test_stl_ast_parser.py HOT 1
- Handling unit with Fraction HOT 3
- IASTL refactoring HOT 2
- PyPi package installs antlr version for python 2 and 3
- Rename from evaluator to interpreter HOT 3
- naming of LTLPastifyException HOT 1
- test_division test case difference between Python and C++ HOT 2
- exception refactoring HOT 2
- Until operator showing key error HOT 1
- ValueError: max() arg is an empty sequence when eventually[time] too long HOT 1
- RTAMT AST data structure document
- AST access HOT 2
- introduction of sub_specs changes robustness traces HOT 1
- Running RTAMT fails due to incorrect antlr version HOT 1
- Please document the Python API HOT 2
- RFE: should there be a more obvious error message when the value at t=0 is not provided?
- StlDenseTimeSpecification semantic bug? HOT 1
- Typos in README.md "Future timed temporal operators" sematics?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rtamt.