Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-36978

Javascript duplicated in each individual javascript file

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Won't Fix
    • blueocean-plugin
    • None
    • dogfood server - ci.blueocean.io

    Description

      Overview

      There are 1113 lines of Javascript code being duplicated into multiple files being returned under blueocean.

      Expected

      Javascript not duplicated unnecessarily

      Actual

      e.g. consider two (of many) resources returned by ci.blueocean.io

      The first 1113 lines are duplicated into each resource

      Attachments

        Activity

          bwalding Ben Walding created issue -
          michaelneale Michael Neale made changes -
          Field Original Value New Value
          Assignee Tom FENNELLY [ tfennelly ]
          michaelneale Michael Neale made changes -
          Epic Link JENKINS-35749 [ 171790 ]
          michaelneale Michael Neale added a comment -

          I gather this is js-bundler, but ideally it would only be loaded once. 9K gzipped per file * bundles == a bit of waste.

          Minified I guess it would go down much smaller of course.

          michaelneale Michael Neale added a comment - I gather this is js-bundler, but ideally it would only be loaded once. 9K gzipped per file * bundles == a bit of waste. Minified I guess it would go down much smaller of course.
          tfennelly Tom FENNELLY added a comment - - edited

          It's bootstraping code - js-modules etc.

          Not a problem imo (definitely not a bug - we love creating JIRA noise on this project ) as it will be tiny on the wire and is better that each bundle has its own copy of this stuff - I can go into the reasons why if we want. We could minify it .... getting rid of the comments alone would probably get rid of about 700 lines.

          tfennelly Tom FENNELLY added a comment - - edited It's bootstraping code - js-modules etc. Not a problem imo (definitely not a bug - we love creating JIRA noise on this project ) as it will be tiny on the wire and is better that each bundle has its own copy of this stuff - I can go into the reasons why if we want. We could minify it .... getting rid of the comments alone would probably get rid of about 700 lines.
          michaelneale Michael Neale added a comment -

          tfennelly ok - currently its 90K (minified would be probably 9K) gzipped, and bwalding personally counts every single bit from his servers.

          I think he pays by the bit.

          OK closing out.

          michaelneale Michael Neale added a comment - tfennelly ok - currently its 90K (minified would be probably 9K) gzipped, and bwalding personally counts every single bit from his servers. I think he pays by the bit. OK closing out.
          michaelneale Michael Neale added a comment -

          no body likes ben.

          michaelneale Michael Neale added a comment - no body likes ben.
          michaelneale Michael Neale made changes -
          Resolution Won't Fix [ 2 ]
          Status Open [ 1 ] Closed [ 6 ]
          tfennelly Tom FENNELLY added a comment -

          I love Ben !!!

          michaelneale What exactly is 90K? I'm faaaaaiiiiiirly sure the duplicate part is way less than that (unminified and ungzipped).

          tfennelly Tom FENNELLY added a comment - I love Ben !!! michaelneale What exactly is 90K? I'm faaaaaiiiiiirly sure the duplicate part is way less than that (unminified and ungzipped).
          michaelneale Michael Neale added a comment -

          9K is the gzipped size of the overhead, x10 resources = 90K.

          at least that is what he told me.

          michaelneale Michael Neale added a comment - 9K is the gzipped size of the overhead, x10 resources = 90K. at least that is what he told me.
          tfennelly Tom FENNELLY added a comment -

          Okay .... if Ben says it then I'm sure it's accurate !!

          There are tradeoffs here and I'd not be in favour of moving these things outside the bundles. If it's a problem then we need to think of other solutions. I want this bootstrap code to be part of the bundle because it's the one thing that the bundle should be able to rely on to be consistent forever (from the time it was built)

          tfennelly Tom FENNELLY added a comment - Okay .... if Ben says it then I'm sure it's accurate !! There are tradeoffs here and I'd not be in favour of moving these things outside the bundles. If it's a problem then we need to think of other solutions. I want this bootstrap code to be part of the bundle because it's the one thing that the bundle should be able to rely on to be consistent forever (from the time it was built)
          bwalding Ben Walding added a comment -

          You're lucky this is a public JIRA or I'd tell you what I really thought of your lack of care and respect for the contributing community you have.
          </career-of-contributing-to-oss>

          bwalding Ben Walding added a comment - You're lucky this is a public JIRA or I'd tell you what I really thought of your lack of care and respect for the contributing community you have. </career-of-contributing-to-oss>
          tfennelly Tom FENNELLY added a comment -

          I wouldn't take that Mic !!

          tfennelly Tom FENNELLY added a comment - I wouldn't take that Mic !!
          michaelneale Michael Neale added a comment -

          bwalding don't you have a hill climb to ride and get left behind on?

          michaelneale Michael Neale added a comment - bwalding don't you have a hill climb to ride and get left behind on?
          michaelneale Michael Neale added a comment -

          but more seriously, WHEN we have minification, it should only be 1K overhead per bundle max. probably less (given most of it is nice comments). The overhead of an extra round trip for an externalised bundle would swamp that

          (and then we get into discussions on asset chains that bundle it all in to main page load, or not, and then http2, or not etc etc).

          What we really need: is servers all over the world so we don't have to worry. DONE.

          michaelneale Michael Neale added a comment - but more seriously, WHEN we have minification, it should only be 1K overhead per bundle max. probably less (given most of it is nice comments). The overhead of an extra round trip for an externalised bundle would swamp that (and then we get into discussions on asset chains that bundle it all in to main page load, or not, and then http2, or not etc etc). What we really need: is servers all over the world so we don't have to worry. DONE.
          bwalding Ben Walding added a comment -

          Conside isomorphic-fetch

          1139 lines of boiler plate
          480 lines of actual code

          But you go ahead and mark this WON'T FIX because your operations team will provision an extra 4 servers to deliver all that boilerplate around the world.

          You're probably right though, the inefficiency of the boilerplate will be swamped by general inefficiencies in Michael's proof-of-concept code that stays in production for 6 years.

          Hypothetically.

          bwalding Ben Walding added a comment - Conside isomorphic-fetch 1139 lines of boiler plate 480 lines of actual code But you go ahead and mark this WON'T FIX because your operations team will provision an extra 4 servers to deliver all that boilerplate around the world. You're probably right though, the inefficiency of the boilerplate will be swamped by general inefficiencies in Michael's proof-of-concept code that stays in production for 6 years. Hypothetically.
          michaelneale Michael Neale added a comment -

          bwalding its perfectly fine for modules to inline the js they want into their own code, and not have an external bundle at all for small things like that (although it means there are N versions of those objects loaded into the browser, which may or may not be worse), but then there wouldn't be the overhead ratio.

          michaelneale Michael Neale added a comment - bwalding its perfectly fine for modules to inline the js they want into their own code, and not have an external bundle at all for small things like that (although it means there are N versions of those objects loaded into the browser, which may or may not be worse), but then there wouldn't be the overhead ratio.
          bwalding Ben Walding added a comment -

          More sensibly...

          I agree there's no point optimising away those lines if they're going to be bundled up together later on. In the grand scheme of things - worrying about those extra lines of code/comments at the moment doesn't really matter when there's plenty of other stuff to deal with.

          Ultimately you have many avenues for performance enhancement - bundle, deduplicate / minify, compress, cache

          bwalding Ben Walding added a comment - More sensibly... I agree there's no point optimising away those lines if they're going to be bundled up together later on. In the grand scheme of things - worrying about those extra lines of code/comments at the moment doesn't really matter when there's plenty of other stuff to deal with. Ultimately you have many avenues for performance enhancement - bundle, deduplicate / minify, compress, cache
          tfennelly Tom FENNELLY added a comment -

          michaelneale

          although it means there are N versions of those objects loaded into the browser, which may or may not be worse

          It's not a problem when they are all inside their own bundle. Each of those bundles are wrapped in an IIFE, so these things are isolated/scoped inside it.

          bwalding

          In the grand scheme of things - worrying about those extra lines of code/comments at the moment doesn't really matter when there's plenty of other stuff to deal with.

          My sentiments exactly ... I'm more than happy to spend time optimising things like this after we have all the bigger fish fried.

          BTW ... I've no problem with this ticket being left open. The only point I made was that I didn't consider it to be a "bug" because it's done this way intentionally and for a good reason, but that's just chat.

          tfennelly Tom FENNELLY added a comment - michaelneale although it means there are N versions of those objects loaded into the browser, which may or may not be worse It's not a problem when they are all inside their own bundle. Each of those bundles are wrapped in an IIFE, so these things are isolated/scoped inside it. bwalding In the grand scheme of things - worrying about those extra lines of code/comments at the moment doesn't really matter when there's plenty of other stuff to deal with. My sentiments exactly ... I'm more than happy to spend time optimising things like this after we have all the bigger fish fried. BTW ... I've no problem with this ticket being left open. The only point I made was that I didn't consider it to be a "bug" because it's done this way intentionally and for a good reason, but that's just chat.

          People

            tfennelly Tom FENNELLY
            bwalding Ben Walding
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: