Performance data collection in Linux (API) [closed] - c++

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I need some library which has comprehensive set of APIs which can help to collect performance data of current machine. Could be very useful if this library written in C++ or Perl.
Tried to googling, since I don't know right terminology for that I found a lot of big and already established projects, which I cannot embed into my code.

What you are looking for is called PAPI Performance Application Programming Interface. It lets you collect data on all performance counters available e.g. FLOP (floating point operations) if you wish to validate your theoretical FLOP count. It also offers an API to compute MFLOPS or even find the cache hit ratio for your application. I have used the library extensively in supporting platforms in addition to Intel VTune.
Here is a list of "native" PAPI events but everything else you will find as CPU native counters.

Related

Looking for APIs to measure battery use of a process [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Question Is there an API for Windows and/or Linux that will let me find out which processes are draining battery?
A few notes:
It doesn't have to be precise, I'd be ok with only three levels (low energy cost/fair energy cost/high energy cost) if that's all I can get.
I already have CPU load information, that's not what I am looking for, as experience shows that processes with very low CPU use can nevertheless drain battery by having high I/O, high swapping or frequent wakeups. This is why I'd like to piggyback on whatever the OS is already using: OS developers are much more likely than me to have actually tested this.
I found a partial solution for macOS. See answers.
MSDN doesn't seem to indicate any energy-related API.
I cannot request admin/root rights for running my task manager, so I cannot simply parse the syslogs looking for power usage alerts.
I've found a great reference for how macOS does it.
https://blog.mozilla.org/nnethercote/2015/08/26/what-does-the-os-x-activity-monitors-energy-impact-actually-measure/
That should be fairly easy to follow.

Should profiling be done on selected platforms or on all the platforms? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Suppose I am developing a general library for multiple platforms: linux, windows, mac, ios and Android. After the library passes the functionality test, in order to improve its performance profiling the library is needed. Then my question is: should i profile it on each different platforms or can I select the most familiar platform and then perform the profiling?
This will depend on what type of optimizations you are planning and how important optimization is. For high level issues, (identifying slow algorithms), it will probably be fine to profile on one platform and the results will be useful on all platforms (as will the resulting improvements). However if you need to dig down to low level issues (assembly, cache optimizations, etc) those will be platform specific and you'll need to work on each platform individually.

Ocaml and Algorithmic Trading [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I'm completely new to the Algorithmic Trading domain. I've just completed a course that was Ocaml based, and read about Jane Street. Obviously they are a huge company with a large amount of resources, but is it feasible to use Ocaml for small time algorithmic trading?
I know that probably seems like a stupid question, but (from what i've found) there aren't any trading APIs for Ocaml. This would mean one would have to written from scratch correct?
Any insight would be greatly appreciated guys, like I said I am a complete noob to this domain.
Thanks!
I've recently noticed this package in Opam that could provide a starting point for a trading API:
"IBX is a pure OCaml implementation of the Interactive Brokers Trader Workstation API (TWS API) built on top of Jane Street's Core and Async library."
As for open source trading algorithms in general this project started recently:
http://scarcecapital.com/hft/
I think this question is probably too open-ended for the Stack Overflow environment to be useful to you. Stack Overflow is for when you have a specific problem you're trying to solve.
But being opinionated, I can't help but say that OCaml might be pretty good for algorithmic trading. The strong typing system and immutable data tend to help avoid errors while allowing you to code quickly. This, at least, is what I've found. But you'd need to plug OCaml in to your data sources and your trade execution channel, which would be extra work. Knowing nothing about this area, I don't know if there are libraries for other languages.
Most likely the folks who are actually doing this have an incentive to keep their secrets to themselves. But that would be true regardless of the language.

Moon phase web service [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am looking for a web service that returns the current moon phase as some kind of string, like "Waxing 88%" or a similar string that I can store later in a database. This is for a mobile app, so would rather not use some of the suggested algorithms to calculate it.
Short of finding this, what is your opinion of calculating this in JavaScript on a device? Will this be too resource intensive?
Based on an article I found describing moon phase calculation, I can tell you already that sending a network request over the internet, waiting for and then parsing a response, and finally dealing with the calculations is far more resource intensive then simply performing arithmetic on the device. It will almost certainly use less computing power, less battery power, and less network bandwidth.
You can find a simplified calculation method here:
http://www.voidware.com/moon_phase.htm
This project uses JavaScript to both calculate and display moon-phase information, and may be more relevant to you:
https://github.com/tingletech/moon-phase

Considering the Chaos Monkey in Designing and Architecting an Embedded Systems [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I work on embedded systems with limited memory and throughput. Making a system more robust requires more memory, and time on the processor. I like the idea of the Chaos Monkey to figure out if your system is fault tolerant, however with limited resources I'm not sure how feasible it is to just keep adding code to it. Are there certain design considerations whether in the architecture or otherwise that would improve the fault handling capabilities, without necessarily adding "more code" to a system?
One way I have seen to help in preventing writing an if then statement in c (or c++) that assigns rather then compares a static value, recommends writing that on the left hand side of the comparison, this way if you try to assign your variable to say the number 5, things will complain and you're likely to find any issues right away.
Are there Architectural or Design decisions that can be made early on that prevent possible redundancy/reliability issues in a similar way?
Yes many other techniques can be used. You'd do well to purchase and read "Code Complete".
Code Complete on Amazon