Git Product home page Git Product logo

Comments (10)

mzgoddard avatar mzgoddard commented on June 8, 2024 4

@MoOx I finally figured out what your experiencing here. HardSource has a safety mechanism to invalidate modules when there cached dependencies are invalid. But HardSource doesn't yet understand dependencies that lead to DelegatedModules used by DllReferencePlugin. So when a cached module depends on a DelegatedModule its always being invalidated. The end result is Modules depending on a module in a DLL will be cached and in the next run invalidated, leading to a rebuild of that Module. Modules in the same run that don't depend on modules in the DLL will not be invalidated and will use the previously cached version.

Now I can finally fix this issue.

from hard-source-webpack-plugin.

mzgoddard avatar mzgoddard commented on June 8, 2024

Just to clarify is that the build time with DllPlugin or DllReferencePlugin?

Assuming DllPlugin, I'm not immediately sure what would be limiting HardSource's impact.

Assuming DllReferencePlugin, HardSource can't improve much for the modules delegated by the DllReferencePlugin. The ReferencePlugin uses DelegatedModules instead of the NormalModules that HardSource caches. If we added caching of DelegatedModuless I don't think it'd change the amount of time spent much, DelegatedModule is pretty light on work, they most likely do far less work than HardSource's HardModule. I'd wonder if the dependency to the module contained in the dll could be causing unnecessary rebuilds of the NormalModules. I'll look at that but I'm doubtful as it should be a normal CommonJsRequireDependency (or HarmonyImportDependency or AMDRequireDependency).

Last thing I'm curious about is how you are using the dll source. Is it another script tag in your html or are you prepending it to your chunk during the webpack build? The latter could be adding time, enough to hide that HardSource is providing a benefit. If so I'd set noParse to excluding the dll from parsing. That would save a lot of time considering its probably a large file. After that there'd be a small amount additional time spent building the resulting chunk and emitting it. (Mostly building the chunk I'd guess.)

from hard-source-webpack-plugin.

mzgoddard avatar mzgoddard commented on June 8, 2024

Oh, so I looked at HardSource + Dll. Check your manifest. My manifest on the first build was correct, but the later build wasn't. I have fix inbound, its because a function on NormalModule wasn't exposed on HardModule that results in the dll building but the manifest being empty.

As this effects the dll build on the second run it'd cause the reference build to revert to using just HardModule's. If the reference build uses the first run of the dll build you should see the DllReferencePlugin taking proper effect.

from hard-source-webpack-plugin.

MoOx avatar MoOx commented on June 8, 2024

The issue I am facing is with DllReferencePlugin. I am using it via script tag to avoid webpack again on this file.

Stuff generated by DllPlugin seemed to look good.

from hard-source-webpack-plugin.

MoOx avatar MoOx commented on June 8, 2024

Will take a second look when I get some time.

from hard-source-webpack-plugin.

mzgoddard avatar mzgoddard commented on June 8, 2024

@MoOx have you been able to take a second look? I tested some myself and for DllReferencePlugin it is working for me.

from hard-source-webpack-plugin.

MoOx avatar MoOx commented on June 8, 2024

With my last test it was "working" but perf were not improved at all (your plugin: 2s, your plugin + dllreference: 12s).

from hard-source-webpack-plugin.

mzgoddard avatar mzgoddard commented on June 8, 2024

@MoOx is there a branch of Phenomic I can checkout relating to this? I have a few working test repos with DllPlugin and DllReferencePlugin that experience a speed up with the Reference plugin and HardSource together. I haven't been able to reproduce a slow down with the two. Until then I'm not sure I can move this issue further.

from hard-source-webpack-plugin.

DavidWells avatar DavidWells commented on June 8, 2024

@MoOx lol wish I saw this thread. Just tried to implement this myself.

Was the conclusion that DLL won't work with hard source?

from hard-source-webpack-plugin.

MoOx avatar MoOx commented on June 8, 2024

Sorry I didn't take time to continue on this since I am pretty happy with the current state of this plugin. DLL plugins involve too much effort from the user configuration with a really small benefit at the end. Not sure I will try again on this. Will take a look if I still have my git stash somewhere :)

from hard-source-webpack-plugin.

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.