buaazp / Godef

Plugin of sublime to use godef to go to definitions accurately.
BSD 3-Clause "New" or "Revised" License
82 stars 24 forks source link

osx 10.10.2 with high cpu useage #8

Closed dyxushuai closed 9 years ago

dyxushuai commented 9 years ago

sublime build 3083 packages: SideBarEnhancements, GoSublime, Godef

when I install godef then sublime was keeping 50% cpu useage

buaazp commented 9 years ago

Hi @JohnSmithX

I'm using sublime 3083 at Mac OS X, too. And I guess it's not godef cause the high cpu usage, it is goimports.

Check you gosublime config and change the fmt_cmd to gofmt like this:

    "fmt_cmd": ["gofmt"],
    // "fmt_cmd": ["goimports"],

After I don't use goimports, the CPU is low and godef plugin is stall work well.

But I'm not sure about this. If you only use godef plugin and the CPU is still high. That will prove godef plugin has some problem and tell me more details.

dyxushuai commented 9 years ago

@buaazp I have a golang file with 500 lines.Then if this file is activated, CPU up. Other smaller files are normally.

dyxushuai commented 9 years ago

@buaazp I think GoSublime cause this problem

dyxushuai commented 9 years ago

@buaazp same problem [https://github.com/DisposaBoy/GoSublime/issues/201]

buaazp commented 9 years ago

Agree with you. When I use gosublime to edit huge project like etcd (more than 100,000 lines code), there will be some lags.

fabriziomoscon commented 7 years ago

gofmt is not the same as goimports using gofmt avoid the cpu going to 100%, but you loose the auto import of libraries when saving