Ngl: Embedded bundle size

Created on 29 May 2016  路  7Comments  路  Source: nglviewer/ngl

Hi,

A question rather than a bug: is it possible at all to reduce the size of ngl.embedded.min.js?

I imagine is must be very complex to optimise, but I wanted to ask because I'll be deploying a project using NGL (yay!) to a public-facing site, so it would be great to optimise the delivery as much as possible. At the moment it's weighing in at ~1.1MB, so my concern is for users with slower connections.

I'm hoping to be able to use a server with gzip compression to minimise the size anyway, but the faster I can get the page to load, the better :)

Many thanks for all your work.

question

Most helpful comment

@arose a bit of a belated response to your comment from last year, but we are officially "live" 馃槃 http://cancer.sanger.ac.uk/cosmic3d/

All 7 comments

ngl.embedded.min.js is gzip about 275鈥塊B

... is it possible at all to reduce the size of ngl.embedded.min.js?

The work I am currently doing in the reorg branch is partly aimed at reducing the size (and making custom builds possible). I hope to get the overall gzipped to around 200 KB. Custom builds can smaller but we'll have to try and see what will be possible.

I'll be deploying a project using NGL (yay!) to a public-facing site

Cool, please let me know when its ready. I would like to make list of showcases.

200KB would be amazing! I must admit I haven't been working with gzip on during development.

Custom builds sound great, am happy to test if that's helpful.

Cool, please let me know when its ready. I would like to make list of showcases.

Sure thing! Am hoping to get an early-stage demo up publicly in the next three months or so; I'll keep you posted.

The current build is 267KB gzipped which still contains the complete three.js lib. I will try https://github.com/rollup/three-jsnext which should drive the size down a lot.

That would be amazing! Will make a huge difference for users. Also great to learn about rollup.

Have a great weekend :)

Have been experimenting more with three-jsnext and can now get a 231KB gzipped build.

The smaller build can be created by using three-jsnext (depends on this https://github.com/rollup/three-jsnext/pull/7). To enable this clone the three-jsnext repository to be a sibling directory of the ngl repository and then change the import from line at the end of lib/three.es6.js to point to three-jsnext-import.js. Finally, rebuild.

@arose a bit of a belated response to your comment from last year, but we are officially "live" 馃槃 http://cancer.sanger.ac.uk/cosmic3d/

Look very nice.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

harryjubb picture harryjubb  路  4Comments

arose picture arose  路  6Comments

stefdoerr picture stefdoerr  路  3Comments

sbliven picture sbliven  路  3Comments

iwatobipen picture iwatobipen  路  4Comments