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 8329415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:46:45+00:00 2026-06-09T01:46:45+00:00

I’m trying to profile some Ruby code I wrote using ruby-prof gem and see

  • 0

I’m trying to profile some Ruby code I wrote using ruby-prof gem and see that basic operations like i += 1 (listed as Fixnum#+ in the table below) take over 24 seconds to run (in this particular test, the operation is performed 2,199,978 times). Is this normal?

Thread 582936

%Total   %Self   Total   Self  Wait  Child       Calls              Name

                 203.93  81.72   0.00  122.21    100001/100001    InputFile#parse
46.96%   18.82%  203.93  81.72   0.00  122.21    100001           InputFile#split_on_semicolon
                  24.59  24.59   0.00    0.00   2199978/3200094   Fixnum#+
                  16.02  16.02   0.00    0.00    100001/399998    String#split
                  14.72  14.72   0.00    0.00    999990/999991    String#[]
                  13.12  13.12   0.00    0.00   1199988/1199990   Fixnum#<
                  10.97  10.97   0.00    0.00    999990/2239978   String#empty?
                  10.49  10.49   0.00    0.00   1199988/1199988   String#<<
                   9.75   9.75   0.00    0.00   1199988/1200074   Array#[]
                   7.77   7.77   0.00    0.00    999990/999990    String#eql?
                   6.76   6.76   0.00    0.00    599994/599994    Fixnum#-
                   4.62   4.62   0.00    0.00    599994/599994    Array#delete_at
                   1.25   1.25   0.00    0.00    100001/1339989   Kernel#nil?
                   1.14   1.14   0.00    0.00    100001/300003    Array#size
                   1.01   1.01   0.00    0.00    100001/300002    Fixnum#>
  • 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-09T01:46:48+00:00Added an answer on June 9, 2026 at 1:46 am

    Your results don’t say += takes 25 seconds. They say that 2199978 calls to + took 24.59 seconds, which comes to 89.5 calls per ms. That’s a bit slow, but probably only because it’s being profiled. I don’t see anything unusual in that.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I am using Paperclip to handle profile photo uploads in my app. They upload
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have some data like this: 1 2 3 4 5 9 2 6

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.