Skip to content

Indent Perfomance #129

Description

@alexesDev

Hi. I see Arbre::HTML::Tag#indent in stackprof top and it confuses me.

  Mode: cpu(1000)
  Samples: 172 (0.00% miss rate)
  GC: 33 (19.19%)
==================================
     TOTAL    (pct)     SAMPLES    (pct)     FRAME
        33  (19.2%)          33  (19.2%)     (garbage collection)
        29  (16.9%)          29  (16.9%)     ActiveSupport::SafeBuffer#initialize
        14   (8.1%)          13   (7.6%)     Arbre::Element#initialize
        11   (6.4%)          11   (6.4%)     Arbre::HTML::Attributes#value_empty?
        19  (11.0%)           8   (4.7%)     Arbre::HTML::Tag#indent
         7   (4.1%)           7   (4.1%)     ActiveSupport::Inflector#demodulize

I test this patch and got a 10% performance boost.
https://gist.github.com/alexesDev/343e22b45fac02fd7f509bb408874f66

Are indents really needed?

Activity

  1. changed the title [-]Intent Perfomance[/-] [+]Indent Perfomance[/+] on May 22, 2019
  2. Fivell commented on Jun 13, 2019

    @Fivell
    Member

    @alexesDev nice catch, imo it can be removed in order to get better performance, @activeadmin/collaborators what do u think ?

  3. deivid-rodriguez commented on Jun 14, 2019

    @deivid-rodriguez
    Member

    Yeah, nice catch! I think the pretty HTML output is a nice feature that might be appreciated by some people, so it'd be nice to find a middle ground. Maybe make the "pretty html" an opt-out feature through configuration?

  4. javierjulio commented on Mar 14, 2023

    @javierjulio
    Member

    I would accept a PR for this if you’re still interested in the change. Thank you.

  5. locked and limited conversation to collaborators on Mar 14, 2023
  6. converted this issue into a discussion #466 on Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions