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

Javascript duplicated in each individual javascript file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Won't Fix
    • Component/s: blueocean-plugin
    • Labels:
      None
    • Environment:
      dogfood server - ci.blueocean.io
    • Similar Issues:
    • Epic Link:

      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

          Hide
          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.

          Show
          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.
          Hide
          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.

          Show
          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.
          Hide
          michaelneale Michael Neale added a comment -

          Ben Walding 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.

          Show
          michaelneale Michael Neale added a comment - Ben Walding 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.
          Hide
          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

          Show
          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
          Hide
          tfennelly Tom FENNELLY added a comment -

          Michael Neale

          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.

          Ben Walding

          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.

          Show
          tfennelly Tom FENNELLY added a comment - Michael Neale 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. Ben Walding 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

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

              Dates

              Created:
              Updated:
              Resolved: