Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8007803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:56:36+00:00 2026-06-04T17:56:36+00:00

I am currently working on some refactoring of a large application under Git version

  • 0

I am currently working on some refactoring of a large application under Git version control.
I wish to be able to benchmark my modified functions between my master branch and my unstable branch.

Currently I am thinking of doing a simple script like :

use Benchmark qw(:all) ;
use my_module ;

$count = -10

# Checkout my master code
system qw(git checkout <my_currently_in_production_version>) ;

timethis($count, sub {my_function()});

# Checkout my unstable code
system qw(git checkout <my_currently_unstable_version>) ;

something_to_reload_my_module();

timethis($count, sub {my_function()});

But it feels kind of hackish to me. Is there any cleaner solution to benchmark functions between Git branches?

Thanks for any help

Edit: I am mainly looking for something like the Benchmark module, but with support of branch changing, if it exist.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T17:56:37+00:00Added an answer on June 4, 2026 at 5:56 pm

    Well, you will need to checkout each version, but I wouldn’t try to “unload” anything. That’s just asking for trouble. That means two Perl interpreters need to be run: one for the old code and one for the new code.

    What I would do is write a script that does the appropriate timings and saves the results to a file. Run it on both checkouts. Have a second script compare the results.

    git checkout stable
    ../tools/time_test > stable
    git checkout unstable
    ../tools/time_test > unstable
    compare_times stable unstable
    

    (The first four lines could be done by compare_times via system.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on a Haskell project which automatically tests some functions based on
I am currently working on some OSGi application and I wanted to use the
Currently I am working on small application in asp.net mvc. It is a some
What are some common strategies for refactoring large state-only objects? I am working on
I'm currently working on an optimization of some C codes under MSVC, in which
I am currently working with some users that do not have the .NET Framework
I am currently working on some Ajax heavy code and I am wondering how
I'm currently working through some exercises in a c++ book, which uses text based
I am currently working on some simple custom allocators in c++ which generally works
I am currently working on some test cases for my website. I've managed to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.