-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
new benchmark module #2768
new benchmark module #2768
Conversation
You need to rebase this on |
I don't know what you based your implementation on but the commit history is (still) a jungle. I tried to rebase it on the current |
sorry for that hustle. now i think it should be ok. |
Build fails now since #2841 was merged:
Please rebase onto current |
@fikin Nikolay in principle this a great idea, and I personally thank you for doing this work. Even so, our process is to raise an issue to discuss, scope and agree a broad implementation strategy, the whats and hows before and in parallel with raising the PR. I missed this when first raised -- my apologies -- I'll take a look over the weekend and then give you my review comments. |
@TerryE : no problem to reshape it on my side. This module was simply an attempt to salvage some otherwise tooling code. |
@devsaurus : right now I'm traveling abroad. First feasible timeslot to look into it is next Tuesday. |
No problem. |
now import errors are fixed. |
@TerryE : would you find some time to post some feedback about this module? |
Nikolay, I still hold the idea of a benchmarking suite is a great idea. However, my main reaction having gone through the code (and the
But as I say, what Lua application programmers really want to know is "how can I speed up my Lua applications" and this is usually a long way behind "how can I free up more RAM?" The base set of tests as described in the references The timing testing code article is useful and whilst flawed is still a useful reference, but I see no advantage in wrapping this in a Lua-callable library. |
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.
See my general comment. A lot further discussion and work needed.
my working assumption for the moment is that benchmarking is serving module developer rather than casual lua-user. hence this module is mainly platform functionality. right now if i have to project the future, i'd imagine this module as dev-branch only available, where people needing cross reference or leaning can compile and use it. and if new functionality comes along extend it. but now that you mentioned about larger scope lua-space testing, i'm kind of intrigued.
you're right that most of these tests are not truly informative for experienced developers, except interrupts perhaps (nodemcu platform seems to be changing enough to want to track this behavior). but by having them provided, a reference is established to another published benchmark. this way comparison and outcomes become much more reliable to interpret. at least that was my thinking when opted for adding them.
sure, i'm learning it as it goes ;) and thanks for the help. i'll spend some time in next days to review how memory hints are being used (i largely copied the code rather than analyse it) and then open up some more on it. |
Nikolay, you'll find my email addr in commits on the git log. If you wish then ping me and we can set an email channel. Here are a few useful references that are quite hard to find:
Even if we are targeting the C module developer, then the benchmarks as proposed are misleading because of cached vs non-cached issues. Espressif don't give details of the cache design and Cadence (like ARM) provide a range of selection options for their licensed SoC manufacturers (see the ISA), so for example we don't even know whether it is direct mapped or two-way associative, but certainly IROM1 cache-miss execution is at least an order slower than cache-hit or ROM or IRAM1 execution. Hence you really need to run the code out of IRAM1 when the instruction timing is absolutely essential, but IRAM is such a scarce resource that we should only put absolutely essential code here. For example, I2C master is sloppy cock tolerant so its drivers don't need to run in IRAM1; caching works well enough in practice. When it comes to C module development, one of the trade-offs that you have to make is when to do stuff in C and when to use Lua. Changing C code requires use of a complete Xtensa toolchain and this is a major hurdle for most developers. Lua code it easily tractable by Lua developers so you will see a trend to only coding functionality in C if there is a compelling reason to. Without an understanding of comparative timing, it is difficult for developers to make this trade-off. |
and explicit getter for ccount register.
@TerryE thanks for the links above i've been sitting on this pull request for some time now, without clear idea where to take it to from here. basically i can't find a good enough way to make it general-purpose beneficial. so my thinking is to close it and keep its codebase as dedicated branch in my repo. |
dev
branch rather than formaster
.docs/*
.this module offers methods which are timing various esp operations. there are timing methods from other people and as well as some new ones. right now it has methods to cover cpu and memory use, some os functions, some gpio operations and even methods to test timer1 performance in all possible combinations.
the module is not an operations module per se but rather something of testing and learning nature. one would use it mainly when wants to evaluate performance aspects of esp. being compiled as lua module makes its use rather easy and convenient.
note: right now the code is based on pwm2 branch as i'm timing exclusive and shared use of timer1 (exclusive api comes with pwm2 commits).