realtimetech-solution / opack Goto Github PK
View Code? Open in Web Editor NEWFast object or data serialize and deserialize library
License: Apache License 2.0
Fast object or data serialize and deserialize library
License: Apache License 2.0
Json Encoding/Decoding 방식 통일화
현재 Json Encoding은 Recursive 방식으로 처리하고 있고, Decoding은 Stack 방식으로 처리하고 있어서 통일화 할 필요가 있다
Opacker에서 serialize/deserialize 진행 시, 대상 Object를 clone해서 관리해야 함.
Object는 참조형이기 때문에, 다른 thread에서 접근할 수 있다. 따라서 serialize/deserialize 진행 중에 접근할 수 없도록, 진행할 Object는 clone을 하여야 한다.
Check the link below
https://www.reddit.com/r/java/comments/u4ytxu/github_realtimetechsolutionopack_fast_object_or/
There are a lot of reflections / dynamic object allocations / boxing operations. This seems inappropriate for many "real-time" systems (is that a goal or does that just happen to be the company name?)
It does not seem to address schema evolution, but I might have missed something
: True.
Lots of if / else-if checks for checking sequential integers? Why not use a switch?
: Expecting somewhat low-level optimizer will work on this.
The used big-endian encoding is more difficult to be optimized later on
List 객체가 Field Transform을 통해 OpackArray로 serialize된 후, Opacker.prepareObjectSerialize() 안에서 element들이 serialize되기 전에 deep clone이 되는 문제.
(serialize된 결과를 확인해보면 List에 serialize가 되지 않은 빈 element들만 추가되어 있다.)
OpackObject({wrappedTypeList=OpackArray([null,test 1,OpackObject({type=com.realtimetech.opack.test.opacker.WrapListElementTest$TestElement, value=OpackObject({})})])})
com.realtimetech.opack.exception.DeserializeException: Can't set intValue field in TestElement
at com.realtimetech.opack.Opacker.executeDeserializeStack(Opacker.java:408)
at com.realtimetech.opack.Opacker.deserialize(Opacker.java:268)
at com.realtimetech.opack.test.opacker.WrapListElementTest.common(WrapListElementTest.java:81)
at com.realtimetech.opack.test.opacker.WrapListElementTest.testWithWrapListTransformer(WrapListElementTest.java:65)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
Caused by: java.lang.IllegalArgumentException: Can not set int field
com.realtimetech.opack.test.opacker.WrapListElementTest$TestElement.intValue to null value
at java.base/jdk.internal.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
at java.base/jdk.internal.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
at java.base/jdk.internal.reflect.UnsafeIntegerFieldAccessorImpl.set(UnsafeIntegerFieldAccessorImpl.java:80)
at java.base/java.lang.reflect.Field.set(Field.java:780)
at com.realtimetech.opack.compile.ClassInfo$FieldInfo.set(ClassInfo.java:79)
at com.realtimetech.opack.Opacker.executeDeserializeStack(Opacker.java:406)
... 93 more
Opacker를 통해 Null element가 들어간 배열을 serialize할 시, NullPointerException 발생
(ex. String[], Integer[])
serialize할 때 array의 element가 null인지 검사를 안함.
Exception in thread "main" java.lang.NullPointerException
at com.realtimetech.opack.Opacker.executeSerializeStack(Opacker.java:150)
at com.realtimetech.opack.Opacker.serialize(Opacker.java:74)
at com.realtimetech.opack.example.Example.main(Example.java:352)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.