[x3d-public] Problem with X3dToJava.xslt (code to large)

John Carlson yottzumm at gmail.com
Mon Dec 20 18:42:44 PST 2021


Addressing the "code too large" scenario (skip first error message, that 
was previously discussed today and I need to recheck the X3DUOM for 
another issue.  This is most likely due to JSON differences).  For 
example, here are 2 different java styles, net/coderextreme (mine) and 
net/x3djsonld (don's).

~/X3DJSONLD/src/main/java$ javac -cp 
.:/home/coderextreme/pythonSAI/X3DJSAIL.4.0.full.jar 
net/coderextreme/data/JinLOA4*java
net/coderextreme/data/JinLOA4.java:70: error: cannot find symbol
           .addValue(new 
MetadataSet().setName("HAnimHumanoid.info").setReference("https://www.web3d.org/documents/specifications/19774/V2.0/Architecture/ObjectInterfaces.html#Humanoid")
           ^
   symbol:   method addValue(MetadataSet)
   location: class HAnimHumanoid
1 error

(note: My JinLOA4_1.java compiles.   But my JSON may be incorrect.)


~/X3DJSONLD/src/main/java$ javac -cp 
.:/home/coderextreme/pythonSAI/X3DJSAIL.4.0.full.jar 
net/x3djsonld/data/JinLOA4*java
net/x3djsonld/data/JinLOA4_1.java:114: error: code too large
     public final void initialize()
                       ^
1 error

Linked is coderextreme (Carlson, not Brutzman) take on reducing method 
size for JinLOA4_1.java.   One may want to try this on some files to 
make sure output is correct.  I don't compare Carlson to Brutzman output 
often.

https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/java/net/coderextreme/data/JinLOA4_1.java

Yes the number of classes really explodes.  Like from 1 class to 600 or 
so.  It would be good to have someone else test my java serializer at 
some point...

I'm not doing optimization yet, although that is important/ Thesource 
code size is around 18K difference (mine is larger). I can't report on 
bytecode size because one test did not produce bytecode.

Corrrectness IS important, and not something I didn't report on in this 
message.   I can't test the correctness of absent bytecode.

John

On 12/20/21 12:05, Brutzman, Donald (Don) (CIV) wrote:
>
> [copy: x3d-public]
>
> Yes, agreed it is a goal, so far my workarounds have not overcome this 
> Java blocker.  Possibly adjustments to the array-dissection method 
> might work.
>
> Please see following for details:
>
>   * https://www.web3d.org/specifications/java/X3DJSAIL.html#TODO
>   * Limitations of Java memory handling: many methods with large
>     blocks of data (greater than 64K compiled) are supported by
>     splitting off arrays portions as separate data structures, when
>     needed, rather than pipelined functional-style instantiations.
>     However some of the extremely large X3D models are simply... too
>     large. See build.java.all.log.txt for console logs from all examples.
>   * https://www.web3d.org/x3d/content/examples/build.java.all.log.txt
>
> all the best, Don
>
> -- 
>
> Don Brutzman  Naval Postgraduate School, Code USW/Br brutzman at nps.edu
>
> Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA    
> +1.831.656.2149
>
> X3D graphics, virtual worlds, navy robotics https:// 
> faculty.nps.edu/brutzman
>
> *From:* John Carlson <yottzumm at gmail.com>
> *Sent:* Sunday, December 19, 2021 8:32 PM
> *To:* Brutzman, Donald (Don) (CIV) <brutzman at nps.edu>; Joseph D 
> Williams <joedwil at earthlink.net>
> *Subject:* Problem with X3dToJava.xslt (code to large)
>
> Probably this is a "don't fix"  I am addressing other JinLOA4_*java 
> next. Attached. _1.java
>
> $ javac -cp .:/home/coderextreme/pythonSAI/X3DJSAIL.4.0.full.jar net/x3d
> jsonld/data/JinLOA4*java
> net/x3djsonld/data/JinLOA4_1.java:114: error: code too large
>        public final void initialize()
>                          ^
> 1 error
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20211220/1dcbe3b5/attachment-0001.html>


More information about the x3d-public mailing list