9 This initial value I have is rather difficult when it comes to elimination.
13 Actually, I could use what I have now as a kind of heuristic and have a spliced
14 off huffman tree which is in four parts. That would reduce the runtime memory
15 requirement so to speak. I would need to be in all active trees at the same
16 time however. If a rover falls off the tree then it is not that route. If I
17 were to visuallize the entire huffman tree and its routes.
21 I would not need a tree if I made a gigantic method which does comparisons on
22 all of the tree values. So basically it would just consist of branches. Then
23 it could exist in the ROM. I do wonder how big such a method would be though
24 since there are byte code limitations.
28 Well the gigantic method of ifs seems faster. The gigantic method of ifs is
29 about 3887 byte codes long. I could actually do better with it. Right now the
30 byte code is just getting the field every single time even though it is final,
31 I can just pass it to the method instead.
35 And having it invoke a method is 3038 bytes of byte code.
39 I can also compact the giant method a bit by removing some of the leaves since
40 now I notice a pattern to the bits.
44 The byte code count really goes down when I compact a large portion of the
45 tree into a single addition.
51 2824 2016-03-11 09:46 net/multiphasicapps/io/DeflateFixedHuffman.class
53 Then removing some very large branches
55 1360 2016-03-11 09:50 net/multiphasicapps/io/DeflateFixedHuffman.class
59 Then a final compaction brings me to:
61 932 2016-03-11 09:53 net/multiphasicapps/io/DeflateFixedHuffman.class
63 So initially it was 3887 reading a field, then 3038 when not reading it. Now
64 with the maximum compaction of the tree it is 156 byte codes long. So this is
65 rather very nice. So what I have now is about 5% original size. So now after
66 having a built-in fixed tree, there is no more need for a global and such. The
67 only thing I require generation for is the dynamic huffman tree.
71 It also just takes up 28 lines of code, which is quite simple. This is compared
72 to the previous 500 or so lines.
76 I am going to need a generic inflation or deflation routine which is then put
77 through a processor. So instead of `InflaterInputStream` there is some kind of
78 chunked stream instead which is initialized with a processor. The input/output
79 stream variants of it would in general just process the bytes. This would be
80 handy because in the future I am going to need a cleaner way to handle GZip
81 and ZLib streams which use Deflate without creating a bunch of wrapped input
86 I believe having a given byte buffer backing for the `CircularBitBuffer`
87 would complicate the implementation.
91 I could just use a boolean array, a smart JVM will just use a compact form of
92 it anyway so I really do not need to worry about space efficiency because it
97 And forcing a minimum number of bits would be easier implementing a
98 decompressor because then I would need to handle partial bit states and such.
99 It would just be easier because I can read a bunch of bits without worrying
100 about running out (during say a fixed huffman read).
104 I can also use a base class for the buffers since right now they have a bunch
109 I cannot use single arrays with the generics though since the types clash
110 with the primitive type and I cannot specify an array of a primitive type.
114 `NoSuchFieldError` and `IncompatibleClassChangeError` are also required by the
115 compiler to operate properly.