Coder Social home page Coder Social logo

mgbenchmark's People

Contributors

mikeantonelli avatar workwithnano avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mgbenchmark's Issues

Add short notation for benchmarking

If you just have one session to measure at a time this macros would be even simpler to use:

benchmark_start("session name")
benchmark_step("step name")
benchmark_total()
benchmark_finish()

<Enhancement> Designate target when starting a new session.

[MGBenchmark start:@"sessionName"] uses the defaultTarget for all sessions.

+ (MGBenchmarkSession *)start:(NSString *)sessionName
{
    __block MGBenchmarkSession *session = [[MGBenchmarkSession alloc] initWithName:sessionName andTarget:defaultTarget];

    dispatch_sync(benchmarkQueue, ^
    {
        sessions[sessionName] = session;
    });

    return session;
}

Consider adding the following, to allow specifying the target when starting a new session:

MGBenchmark.h

/**
 * Starts a new session and assigns the target. An instance
 * of the session is returned.
 */
+ (MGBenchmarkSession *)start:(NSString *)sessionName target:(id<MGBenchmarkTarget>)target;

MGBenchmark.m

+ (MGBenchmarkSession *)start:(NSString *)sessionName
{
    return [self start:sessionName target:defaultTarget];
}

+ (MGBenchmarkSession *)start:(NSString *)sessionName target:(id<MGBenchmarkTarget>)target
{
    __block MGBenchmarkSession *session = [[MGBenchmarkSession alloc] initWithName:sessionName andTarget:target];

    dispatch_sync(benchmarkQueue, ^
    {
        sessions[sessionName] = session;
    });

    return session;
}

SIGSEGV

Occasionally (0.03%) benchmarking a step in our game causes this crash:

Exception Type:  SIGSEGV
Exception Codes: SEGV_ACCERR at 0x220826ed
Crashed Thread:  0

Thread 0 Crashed:
0   libobjc.A.dylib                     0x392525b0 _objc_msgSend + 16
1   PocketUniverse                      0x0020cae5 -[MGBenchmarkSession timePassedSince:] (MGBenchmarkSession.m:82)
2   PocketUniverse                      0x0020c9b9 -[MGBenchmarkSession step:] (MGBenchmarkSession.m:60)
[...]

It's called from various different places. No repeating pattern to see.

Allow to disable benchmarking

You might not want to have the benchmark running in the live environment. The lib should provide an easy way to disable the execution.

Add custom target for listing steps by execution time

If you measure different steps for a session, you might be interested in what actually takes the longest. Therefore a target that just collects data for each step and then prints out a sorted list of steps on demand would be helpful.

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.