Reply to comment

ChaiScript Performance Updates

ChaiScript is a trivially easy to use scripting language designed for integration with C++. I have been working on it with Jon for the past several months now, and we have reached the point of doing performance optimizations and minor bug fixes.

Over the past week I have been profiling the ChaiScript runtime dispatch engine and found a few places to perform optimizations. Using Valgrind, an application that monitors function calls and relative runtime's of functions, I generated a "callgrind" call graph log, opened the log with kcachegrind and analyzed the list of most called and most expensive functions.

The result of the analysis was that the Boxed_Value::Object_Cache::cull and dispatch functions were the most costly. I was able to drastically reduce the cost of dispatch by reducing the amount of exceptions thrown to determine the appropriate function to dispatch to. Also, I modified the cull process to run 1/5 as often as it was.

Now, ChaiScript scripts execute in 1/3 the time (10 seconds vs 30 seconds for a particularly long script). I was able to confirm that cull and dispatch are no longer the most costly functions during execution by re-running the analysis. The performance enhancements are available in the source-only 1.2 release posted yesterday.

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote>
  • Lines and paragraphs break automatically.
  • You may post PHP code. You should include <?php ?> tags.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo]. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.
  • Images can be added to this post.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.