gogen icon indicating copy to clipboard operation
gogen copied to clipboard

feat: go list all pkgs and cache them to improve build speed

Open LiusCraft opened this issue 1 year ago • 1 comments

gop compiler is much slower than go

This PR optimization: reduce the number of times to execute the go list command to improve construction speed

Use this command to optimize the map cache: exec Command ("go", "list", "- f", "{{. ImportPath}}", {{. Export}} "," - export "," all ")

befor: 17086942475208

after: 17086942576052

LiusCraft avatar Feb 23 '24 14:02 LiusCraft

Codecov Report

Attention: Patch coverage is 90.47619% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 95.99%. Comparing base (18cd65e) to head (27b6a9f). Report is 7 commits behind head on main.

:exclamation: Current head 27b6a9f differs from pull request most recent head aced8c5. Consider uploading reports for the commit aced8c5 to get more accurate results

Files Patch % Lines
packages/imp.go 90.47% 3 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #397      +/-   ##
==========================================
- Coverage   96.16%   95.99%   -0.18%     
==========================================
  Files          15       15              
  Lines        6076     6111      +35     
==========================================
+ Hits         5843     5866      +23     
- Misses        177      186       +9     
- Partials       56       59       +3     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Feb 23 '24 14:02 codecov[bot]

See https://github.com/goplus/gogen/blob/main/packages/cache/cache.go

xushiwei avatar Apr 06 '24 14:04 xushiwei