Comments (2)
Thanks for posting. Can you add to the proposal the following:
- how the duplicator will be selected?
- Would having a deduper require the field to be lazy evaled (as in #1373)?
- Can deduping made optional in the generator?
- Should it impact instantiation outside binary deserialization:
fromPMessage
(JSON, Spark)
from scalapb.
how the duplicator will be selected?
One of the options - provide a name of class, that implements DeduplicatorProvider
interface:
trait DeduplicatorProvider {
def getOrCreateDeduplicator[T: ByteStringCodec]: Deduplicator[T]
}
This name may be provided on generator, package, file or even field level.
Would having a deduper require the field to be lazy evaled (as in #1373)?
Actually they are related, but not tight coupled. You may want to reduce memory footprint of common objects even if they are eagerly parsed.
So, if you deserialize some string or message type, you may pass your already delimeted ByteString
to Deduplicator
and check the cache presence by ByteString
hashing / comparision.
Can deduping made optional in the generator?
Sure, it may be done completely optional on any configuration level.
Also, I also found useful to disable it at for some field - like we have a case, where there is some string description field, which doesn't contribute anything for business logic, but will pollute the strings cache if we will try to deduplicate it. Ideally I would prefer to keep this field lazy & non-cacheable.
This may be achieved by checking the presense of deduplicate field / message option and disable it for field which shouldn't be cached.
Should it impact instantiation outside binary deserialization: fromPMessage (JSON, Spark)
I think so.
from scalapb.
Related Issues (20)
- Spark 3.2.1 and sparksql32-scalapb0_11 encoder error HOT 1
- [proposal] Make an option for lazy-deserialization of complex types HOT 3
- Field options for types HOT 4
- Converting the result List[MAp[String,Any]] into scala.Option[com.google.protobuf.struct.Struct] HOT 3
- Feature request: add the ability to change the name of a rpc function HOT 3
- Update protobuf-java to 3.19.6 HOT 1
- Support and document buf HOT 13
- FieldMaskUtil.merge support HOT 4
- Field named `instance_of` in `oneof` causes redefinition of `isInstanceOf`
- [proposal] Allow Custom Generator Options HOT 5
- DataBricks imports `spark.implicits._` by default, is there a way to get around this? HOT 1
- trouble building under java8 on arm64 HOT 5
- Option message in option.proto fails HOT 1
- Efficiently convert bytes to strings HOT 6
- Spark 3.3 NoSuchMethodErorr HOT 7
- A way to set level preserve_unknown_fields for the project level. HOT 4
- Option to generate `class` instead of `case class` HOT 1
- Protobuf map with message as value won't compile HOT 3
- `collection_type` and `extends` with a `repeated` field does not compile HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scalapb.