Coder Social home page Coder Social logo

motion-dtrace's Introduction

motion-dtrace

Proof of concept to use dtrace on rubymotion. Check the demo at You Tube.

Installation

gem install motion-dtrace

You also need to install gnu-grep since grep used on mac is no more compatible !

brew install grep

Usage

Edit the Rakefile of your RubyMotion project and add the following require line.

require 'rubygems'
require 'motion-dtrace'

Start simulator process:

rake

On another terminal, start dtrace:

rake dtrace

When you terminate the app, you get a trace similar to following:

                         CLASS#METHOD                          TOTAL TIME µsec
--------------------------------------------------------------------------------
                       CGPoint#y=:                             3
                        String#nil?                            3
                         Array#last                            4
                        CGRect#origin                          4
                Evernote::Note#title                           4
                          Hash#empty?                          4
                          ........
                         Class#all:                            19867
                       UIImage#thumbnail                       24226
                  DTWebArchive#thumbnail                       24415
                      ClipItem#thumbnail                       24451
                    __NSArrayM#each                            24717
          ClipperTableViewCell#item=:                          25143

Extra

You may specify your own dtrace file via:

rake dtrace DTRACE=/Users/siuying/Documents/workspace/motion/motion-dtrace/dtrace/methods_duration.d

TODO

Currently this gem is just a hack to simplify command lines.

We shall investigate can we do real integration with project.

Credit

motion-dtrace's People

Contributors

siuying avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.