Giter Club home page Giter Club logo

Comments (6)

xushiwei avatar xushiwei commented on May 27, 2024

This is mainly due to the performance of the import function (by https://pkg.go.dev/golang.org/x/tools). This has been solved before, but the burden was relatively heavy, so we gave up the optimization later. After v1.2.0 is released, we will pick up performance optimization again.

这个主要是由于 import 功能的性能导致,这个之前曾经解决过,但是负担比较重所以后来放弃了优化,在 v1.2.0 发布后,接下来我们会把性能优化重新捡起来。

from gop.

xushiwei avatar xushiwei commented on May 27, 2024

I use a mac, but it's not as exaggerated as you said. There may be other reasons why Windows is slow.

% cat t.gop

age := 10
echo "age = ${age}"

% time gop run t.gop

age = 10

gop run t.gop 0.39s user 0.85s system 85% cpu 1.448 total

from gop.

sqhua avatar sqhua commented on May 27, 2024

Thank you for your reply, Xu Da. I also tested on Win10's WSL, and the performance was slightly better. Here are the results:

>> time gop build a.gop

real    0m2.585s
user    0m0.512s
sys     0m0.912s

Then I tested the same command using PowerShell:

>> Measure-Command {gop build a.gop}

Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 5
Milliseconds      : 405
Ticks             : 54051775
TotalDays         : 6.25599247685185E-05
TotalHours        : 0.00150143819444444
TotalMinutes      : 0.0900862916666667
TotalSeconds      : 5.4051775
TotalMilliseconds : 5405.1775

感谢许大的回复,我也在Win10的WSL下做了测试,性能稍好一些,如下:

time gop build a.gop

real 0m2.585s
user 0m0.512s
sys 0m0.912s

然后我用PowerShell再做了同样命令的测试,如下:

Measure-Command {gop build a.gop}

Days : 0
Hours : 0
Minutes : 0
Seconds : 5
Milliseconds : 405
Ticks : 54051775
TotalDays : 6.25599247685185E-05
TotalHours : 0.00150143819444444
TotalMinutes : 0.0900862916666667
TotalSeconds : 5.4051775
TotalMilliseconds : 5405.1775

我没开杀毒软件,推测可能gop对Win系统的某些调用还能再优化

from gop.

xushiwei avatar xushiwei commented on May 27, 2024

The compilation speed of the latest version of Go+ has also been improved a lot. Compiling the complete Go+ tutorial (https://github.com/goplus/tutorial) has been increased by 50 times, and compiling all examples from the spx repository (https://github.com/goplus/spx) is also 10x faster.

At present, two things related to import are mainly optimized: 1) share importer, so that all projects import the same pkg only happen once. 2) Significantly improve the performance of Go+ init package and reduce a large number of unnecessary repeated checks.

from gop.

sqhua avatar sqhua commented on May 27, 2024

我通过源码编译的新版本,似乎性能没有变化,很奇怪:

PS D:\gop-1.2.2\bin> gop version
gop v1.2.2 windows/386

PS D:\gop-1.2.2\bin> Measure-Command {gop build a.gop}
TotalSeconds : 6.0107325

from gop.

xushiwei avatar xushiwei commented on May 27, 2024

This optimization is not related to windows.

from gop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.