+
Skip to content
This repository was archived by the owner on Jul 3, 2025. It is now read-only.
This repository was archived by the owner on Jul 3, 2025. It is now read-only.

Colorizer makes loading files really slow #30

@mauromorales

Description

@mauromorales

I was trying colorizer with a file that was ~58K lines long and it was taking more than 15 seconds to load. Looking into Vim profiler it seems that most of the time was spent on the function PreviewColorInLine()

FUNCTION  <SNR>24_PreviewColorInLine()                                                                                                                                                        
Called 58187 times                                                                                                                                                                            
Total time:  14.430544                                                                                                                                                                        
 Self time:   2.961442                                                                                                                                                                        

count  total (s)   self (s)                                                                                                                                                                   
58187              0.137628   let line = getline(a:where)                                                                                                                                     
232748              0.306366   for Func in s:ColorFinder                                                                                                                                      
174561  12.106593   0.637491     let ret = Func(line, a:where)                                                                                                                                
                                " returned a list of a list: color as #rrggbb, text pattern to highlight                                                                                      
174561              0.206301     for r in ret                                                                                                                                                 
                                  call s:SetMatcher(r[0], r[1])                                                                                                                               
                                endfor                                                                                                                                                        
174561              0.162987   endfor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载