Permalink
Switch branches/tags
Commits on Feb 9, 2016
Commits on Feb 8, 2016
  1. Fix CurrentSettings autoload bug in development.

    huacnlee authored and rymai committed Jan 21, 2016
    Error: A copy of Gitlab::CurrentSettings has been removed from the module tree but is still active
Commits on Jan 13, 2016
  1. Add changelog

    huacnlee committed Jan 13, 2016
Commits on Jan 12, 2016
Commits on Jan 11, 2016
Commits on Dec 16, 2015
  1. Avoid allocations in Ability class.

    huacnlee committed Dec 16, 2015
    It won't change anything after they are first invoke, so add method cache to avoid allocations and avoid GC.
    
    Benchmarks:
    
    ```
    Calculating -------------------------------------
    project_guest_rules without method cache
                            79.352k i/100ms
    project_guest_rules with method cache
                            93.634k i/100ms
    -------------------------------------------------
    project_guest_rules without method cache
                              2.865M (±32.5%) i/s -     11.982M
    project_guest_rules with method cache
                              4.419M (± 7.4%) i/s -     22.004M
    
    Comparison:
    project_guest_rules with method cache:  4418908.0 i/s
    project_guest_rules without method cache:  2864514.0 i/s - 1.54x slower
    
    Calculating -------------------------------------
    project_report_rules without method cache
                            53.126k i/100ms
    project_report_rules with method cache
                            97.473k i/100ms
    -------------------------------------------------
    project_report_rules without method cache
                              1.093M (±36.5%) i/s -      4.675M
    project_report_rules with method cache
                              4.420M (± 7.2%) i/s -     22.029M
    Comparison:
    project_report_rules with method cache:  4420054.3 i/s
    project_report_rules without method cache:  1092509.6 i/s - 4.05x slower
    ```
    
    https://gist.github.com/huacnlee/b04788ae6df42fe769e4
Commits on Nov 18, 2015
Commits on Nov 17, 2015
  1. Avoid render edit_form when visitor can't edit them.

    huacnlee committed Nov 16, 2015
    Reverted #9820, github/task_list need a form, textarea for update.
Commits on Nov 12, 2015
  1. Add caching for ApplicationSetting, Ci::ApplicationSetting.

    huacnlee committed Nov 12, 2015
    ApplicationSetting.current was called in every pages, cache it and expires it after it updated.
    
    This changes will avoid a SQL query in every pages (~0.3 - 0.5ms).
    
    ```SQL
    SELECT  "application_settings".* FROM "application_settings"   ORDER BY "application_settings"."id" DESC LIMIT 1
    ```
  2. Avoid render edit_form in each notes.

    huacnlee committed Nov 12, 2015
    Use RJS to render edit note feature.
    
    Before:
    
    ```
    Rendered projects/notes/_note.html.haml (27.9ms)
    Rendered projects/_zen.html.haml (0.3ms)
    Rendered projects/notes/_hints.html.haml (0.7ms)
    Rendered projects/_md_preview.html.haml (3.9ms)
    Rendered projects/notes/_edit_form.html.haml (6.9ms)
    Rendered projects/notes/_note.html.haml (17.7ms)
    Rendered projects/_zen.html.haml (0.3ms)
    Rendered projects/notes/_hints.html.haml (0.6ms)
    Rendered projects/_md_preview.html.haml (3.4ms)
    Rendered projects/notes/_edit_form.html.haml (7.0ms)
    ```
    
    After:
    
    ```
    Rendered projects/notes/_note.html.haml (13.8ms)
    Rendered projects/notes/_note.html.haml (7.1ms)
    Rendered projects/notes/_note.html.haml (9.5ms)
    Rendered projects/notes/_note.html.haml (8.5ms)
    ```
    
    This change reduce at least 6ms * N ('N' - number of notes).
Commits on Nov 10, 2015
  1. Replace CoffeeScript block into JavaScript in Views.

    huacnlee committed Nov 10, 2015
    For example view: shared/issuable/_context
    
    CoffeeScript: 190ms
    JavaScript: 19.7ms
Commits on Oct 23, 2015
  1. Fix API::APIHelpers -> API::Helpers;

    huacnlee committed Oct 22, 2015
    Rails Autoload find file to require is use , APIHelpers -> api_helpers.rb, not helpers.rb;