Code Monkey home page Code Monkey logo

Comments (7)

ondys avatar ondys commented on August 15, 2024 7

We did our first pass on the javascript decoder size, which included separating mesh and point cloud decoders into two .js files + turning on extra flags that reduced the javascript size without hurting the performance (the performance should be actually slightly better now).

From the previous draco_decoder.js (878 KB) we are now down to 585 KB for draco_mesh_decoder.js .. so about 33% reduction. Still far from perfect, but getting better.

Note that we now include 3 different javascripts:
draco_decoder.js - still contains both mesh and point cloud decoders
draco_mesh_decoder.js - only mesh decoding
draco_point_cloud_decoder.js - only point cloud decoding

We will still keep working on this so I'm going to keep the issue open

from draco.

ondys avatar ondys commented on August 15, 2024 3

We actually did write a javascript decoder manually some time ago, but it is now rather outdated and not compatible with the current bitstream. If there is a strong demand we may look into that again.

Saying that, what we plan to do in the near future is to add an option to add/remove features that are included in the decoder. For example if you know that your input files are only meshes, you will be able to exclude all functionality specific to point clouding, which would reduce the decoder size quite a bit. We actually already have a limited support for this in the Empscripten makefile (look for DRACO_CONFIG_DEFINES), but on a very few features can be disabled at this time.

from draco.

openforus avatar openforus commented on August 15, 2024

when I run "make -f Makefile.emcc" in os x EI Capitan to compile generated draco_decoder.js code
get the following compile errors:

In file included from javascript/emscripten/draco_glue_wrapper.cc:26:
./glue.cpp:148:14: error: cannot initialize a parameter of type 'const char *'
with an lvalue of type 'char'
self->Init(arg0, arg1);
^~~~
./core/decoder_buffer.h:38:25: note: passing argument to parameter 'data' here
void Init(const char *data, size_t data_size);
^
1 error generated.
ERROR:root:compiler frontend failed to generate LLVM bitcode, halting
make: *** [obj/javascript/emscripten/draco_glue_wrapper.o] Error 1

So how to resolve this problem?

from draco.

hccampos avatar hccampos commented on August 15, 2024

Being able to remove unnecessary features is indeed a great idea, so I would like so second that.

from draco.

ondys avatar ondys commented on August 15, 2024

@openforus Thanks for the report. I was able to repro the problem. As far as I can tell this is a MacOS specific issue. We will post an update when we have a fix. Also, in future, please consider opening a new issue when reporting problems. It makes things easier to track.

from draco.

marklundin avatar marklundin commented on August 15, 2024

Would a WebAssembly Decoder make sense in this instance?

from draco.

ondys avatar ondys commented on August 15, 2024

@marklundin Yes, WebAssembly is going to make the decoder smaller as well.

from draco.

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.