Result::ok() Y U NO go faster?


So it turns out that juce::Result is showing up in my profile:

In my key/value database functions I have a lot of this:

Result func ()
  Result result (Result::ok ());

  if (some_call_failed ())
    result = Result ("uh oh");

  return result;

Jules help!!!


Nice profile. what are you using to profile and do you recommend it?



I’m using Intel VTune Amplifier, which is part of the Intel C++ Studio XE 2012.

I highly recommend this product if you are developing under Visual Studio 2010 or Visual Studio 2012. It works flawlessly, on any project, and has every option you can think of. The integration into Visual Studio is the best I’ve ever seen. It behaves even better than the IDE itself (lol).

Plus, you can with just the selection of a menu item, switch your entire project over to using the Intel C++ compiler seamlessly. Having an extra compiler to build against makes it easier to catch non-portable usage of code. The Intel compiler also has more warnings for static analysis than Visual C++ compiler. It also produces better code.

The only problem is the price… $1599 for a single user license. But it’s worth it for me.

I don’t recommend any of the libraries that Intel provides like the Intel Performance Primitives or any of that stuff. I dislike having to link to static libraries in general, and there are also restrictions on open source redistribution.

I stick to the Intel C++ Compiler and the VTune Analyzer.


Bizarre - all it does in there is to initialise an empty string, which does no allocations or anything funny. I guess there might be an atomic ref-count op involved… I’ve tweaked it now to make it use String’s default constructor, just in case that speeds things along a bit!