Skip to content

Improve indent performance #6

Description

@Deraen

guns/vim-clojure-static#88

With 6b18b4e test script, master:

FUNCTIONS SORTED ON SELF TIME
count  total (s)   self (s)  function
29646              4.656598  <SNR>35_syn_id_name()
 1532   5.261001   0.407066  <SNR>35_match_pairs()
29028   4.712738   0.186393  <SNR>35_ignored_region()
28332   4.856748   0.155025  <SNR>35_is_paren()
30068              0.059254  <SNR>35_current_char()
  417   5.570994   0.033857  GetClojureIndent()
  417   5.439542   0.032423  <SNR>35_clojure_indent_pos()
  315   1.959061   0.012072  <SNR>35_clojure_is_method_special_case_worker()
  416   0.112460   0.006156  <SNR>35_clojure_check_for_string_worker()
  416   0.116510   0.004050  <SNR>35_check_for_string()
  581              0.003795  <SNR>35_strip_namespace_and_macro_chars()
  130              0.003790  <SNR>35_match_one()
  581              0.003502  <SNR>35_current_word()
  315   1.962500   0.003439  <SNR>35_is_method_special_case()
 1395              0.002532  <SNR>35_bracket_type()
  315              0.001042  <SNR>35_is_reader_conditional_special_case()

Because indent uses the syntax rules, #5 branch already improves this a quite bit:

FUNCTIONS SORTED ON SELF TIME
count  total (s)   self (s)  function
29646              1.478719  <SNR>35_syn_id_name()
 1532   2.199816   0.404030  <SNR>35_match_pairs()
29028   1.617763   0.185423  <SNR>35_ignored_region()
28332   1.798798   0.156209  <SNR>35_is_paren()
30068              0.059659  <SNR>35_current_char()
  417   2.391534   0.034190  GetClojureIndent()
  417   2.312287   0.032532  <SNR>35_clojure_indent_pos()
  315   0.809202   0.011783  <SNR>35_clojure_is_method_special_case_worker()
  416   0.046043   0.006287  <SNR>35_clojure_check_for_string_worker()
  130              0.004105  <SNR>35_match_one()
  581              0.004033  <SNR>35_strip_namespace_and_macro_chars()
  416   0.050047   0.004003  <SNR>35_check_for_string()
  581              0.003524  <SNR>35_current_word()
  315   0.812542   0.003340  <SNR>35_is_method_special_case()
 1395              0.002603  <SNR>35_bracket_type()
  315              0.001093  <SNR>35_is_reader_conditional_special_case()

Testing against Reagent src/reagent/impl/component.cljs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions