Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Incremental linker #1626

Closed
Closed
@japgolly

Description

@japgolly

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature request (that does not concern language semantics, see "language")

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions