The Wayback Machine - https://web.archive.org/web/20200908100153/https://github.com/scala-js/scala-js/issues/1626/
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incremental linker #1626

Open
japgolly opened this issue Apr 30, 2015 · 8 comments
Open

Incremental linker #1626

japgolly opened this issue Apr 30, 2015 · 8 comments
Labels

Comments

@japgolly
Copy link
Contributor

@japgolly japgolly commented Apr 30, 2015

A while back on gitter chat, we were talking about the linker being slow.

ramnivas April 1 2015  
@sjrd as an additinal data point to @matthughes, here is output from my fastOptJS run
 https://gist.github.com/ramnivas/723b816bef73a4592a7f
The change I made was a trivial one ("foo" -> "fooo")

sjrd April 1 2015  
Seems you would also benefit from an incremental linker.

ramnivas April 1 2015  
That will be awesome!

japgolly April 1 2015  
Me too  This is my output from after just adding a newline to a file:
[debug] Linker: Read info: 21185 us
[debug] Linker: Compute reachability: 381551 us
[debug] Linker: Assemble LinkedClasses: 1576527 us
[debug] Linker: cache stats: reused: 13811 -- invalidated: 6 -- trees read: 6
[debug] Linker: 1983960 us
[debug] Inc. optimizer: Batch mode: false
[debug] Inc. optimizer: Incremental part: 18653 us
[debug] Inc. optimizer: Optimizing 6 methods.
[debug] Inc. optimizer: Optimizer part: 1425 us
[debug] Inc. optimizer: 34441 us
[debug] Refiner: Compute reachability: 289414 us
[debug] Refiner: Assemble LinkedClasses: 18914 us
[debug] Refiner: 308436 us
[debug] Emitter: Class tree cache stats: reused: 3125 -- invalidated: 5
[debug] Emitter: Method tree cache stats: resued: 14569 -- invalidated: 6
[debug] Emitter (write output): 832415 us
@ramnivas Your times are massive! How large is your codebase mate?

ramnivas April 1 2015  
@japgolly Only about 100 *.scala files (spread over 6 subprojects)
This is for the web part only
@japgolly How large is your codebase, mate?

japgolly April 1 2015  
Interesting. My SJS project is 131 files and 9762 LoC.
(Plus a bunch of lib deps like scalaz, scalajs-react, monocle, etc etc)
Your linker takes 80% more time than mine.
What machine are you running on?

ramnivas April 1 2015  
LoC for my project is at 3820
Macbook Pro late model 2.5GHz i7, 16 MB RAM, SSD

japgolly April 1 2015  
My env = Arch Linux, i7-3770 CPU @ 3.40GHz (8 core), 16gb ram, SSDs
Cool, machine difference probably explains why your's takes longer

ramnivas April 1 2015  
Right

japgolly April 1 2015  
It will be awesome if SJS gets an incremental linker. Saving 2, 3 seconds makes a big difference when you change something small and just want to refresh the browser.

ramnivas April 1 2015  
I definitely noticed that machine difference is a significant factor. On another i5 machine, it takes about twice as much
Right. And I like many have tendency to make many many small changes, so it quickly adds up.
More important than elapsed time is breaking of the change code-see the effect rhythm
@gzm0 gzm0 added the enhancement label Apr 30, 2015
@easel
Copy link

@easel easel commented May 24, 2016

Here's another datapoint for reference:

[debug] Linker: Compute reachability: 724510 us
[debug] Linker: Assemble LinkedClasses: 85611 us
[debug] Basic Linking: 821394 us
[debug] Inc. optimizer: Batch mode: false
[debug] Inc. optimizer: Incremental part: 12683 us
[debug] Inc. optimizer: Optimizing 1 methods.
[debug] Inc. optimizer: Optimizer part: 9294 us
[debug] Inc. optimizer: 35224 us
[debug] Refiner: Compute reachability: 556680 us
[debug] Refiner: Assemble LinkedClasses: 26472 us
[debug] Refiner: 583272 us
[debug] Emitter: Class tree cache stats: reused: 1193 -- invalidated: 1629
[debug] Emitter: Method tree cache stats: resued: 14685 -- invalidated: 1
[debug] Emitter (write output): 318075 us
[debug] Global IR cache stats: reused: 2922 -- invalidated: 10 -- trees read: 9

That's a one-character change to a string constant on a MacBook Pro 2.7ghz quad core. Suffice it to say I am fully supportive of incremental reachability analysis!

@gzm0
Copy link
Contributor

@gzm0 gzm0 commented May 24, 2016

@zach-albia
Copy link

@zach-albia zach-albia commented Feb 8, 2017

Any news on this? Running PhantomJS tests on my i5, SSD machine on my small ~1000 LOC codebase currently clocks in at 15 seconds. In my experience fastOptJs just takes too long to run.

@sjrd
Copy link
Member

@sjrd sjrd commented Feb 8, 2017

No news, I'm afraid. This is currently not a priority, as it is a non-functional requirement. We are focusing on functional requirements until 1.0.0 is released.

@gzm0
Copy link
Contributor

@gzm0 gzm0 commented May 14, 2019

@vjovanov this is the one you meant, right?

@vjovanov
Copy link

@vjovanov vjovanov commented May 14, 2019

Yes, that is the one. It can serve as a good starting point.

@gzm0 gzm0 added this to the Post-v1.0.0 milestone May 22, 2019
@gzm0
Copy link
Contributor

@gzm0 gzm0 commented May 29, 2019

@jvican this

@gzm0 gzm0 removed this from the Post-v1.0.0 milestone Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.