Fix:CSS media queries solve mobile adaptation issues#202
Merged
Conversation
HsiangNianian
approved these changes
Nov 10, 2024
chaokunyang
added a commit
that referenced
this pull request
Oct 27, 2025
## What does this PR do?
This PR implements type meta encoding for java proposed in #1240 .
The type meta encoding in xlang spec proposed in #1413 will be finished
in another PR based on this PR.
The spec has been updated too:
type meta header
```
| 8 bytes meta header | meta size | variable bytes | variable bytes | variable bytes |
+-------------------------------+-----------|--------------------+-------------------+----------------+
| 7 bytes hash + 1 bytes header | 1~2 bytes | current class meta | parent class meta | ... |
```
And the encoding for packge/class/field name has been updated to:
```
- Package name encoding(omitted when class is registered):
- encoding algorithm: `UTF8/ALL_TO_LOWER_SPECIAL/LOWER_UPPER_DIGIT_SPECIAL`
- Header: `6 bits size | 2 bits encoding flags`. The `6 bits size: 0~63` will be used to indicate size `0~62`,
the value `63` the size need more byte to read, the encoding will encode `size - 62` as a varint next.
- Class name encoding(omitted when class is registered):
- encoding algorithm: `UTF8/LOWER_UPPER_DIGIT_SPECIAL/FIRST_TO_LOWER_SPECIAL/ALL_TO_LOWER_SPECIAL`
- header: `6 bits size | 2 bits encoding flags`. The `6 bits size: 0~63` will be used to indicate size `1~64`,
the value `63` the size need more byte to read, the encoding will encode `size - 63` as a varint next.
- Field info:
- header(8
bits): `3 bits size + 2 bits field name encoding + polymorphism flag + nullability flag + ref tracking flag`.
Users can use annotation to provide those info.
- 2 bits field name encoding:
- encoding: `UTF8/ALL_TO_LOWER_SPECIAL/LOWER_UPPER_DIGIT_SPECIAL/TAG_ID`
- If tag id is used, i.e. field name is written by an unsigned varint tag id. 2 bits encoding will be `11`.
- size of field name:
- The `3 bits size: 0~7` will be used to indicate length `1~7`, the value `6` the size read more bytes,
the encoding will encode `size - 7` as a varint next.
- If encoding is `TAG_ID`, then num_bytes of field name will be used to store tag id.
- Field name: If type id is set, type id will be used instead. Otherwise meta string encoding length and data will
be written instead.
```
## Meta size
Before this PR:
```java
class org.apache.fury.benchmark.data.MediaContent 78
class org.apache.fury.benchmark.data.Media 208
class org.apache.fury.benchmark.data.Image 114
```
With this PR:
```java
class org.apache.fury.benchmark.data.MediaContent 53
class org.apache.fury.benchmark.data.Media 114
class org.apache.fury.benchmark.data.Image 68
```
The size of class meta reduced by half, which is a great gain.
The size can be reduded more if we introduce field name hash, but it's
not related to this PR. We can discuss it in another PR.
## Related issues
#1240
#203
#202
## Does this PR introduce any user-facing change?
<!--
If any user-facing interface changes, please [open an
issue](https://github.com/apache/incubator-fury/issues/new/choose)
describing the need to do so and update the document if necessary.
-->
- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?
## Benchmark
<!--
When the PR has an impact on performance (if you don't know whether the
PR will have an impact on performance, you can submit the PR first, and
if it will have impact on performance, the code reviewer will explain
it), be sure to attach a benchmark data here.
-->
chaokunyang
added a commit
that referenced
this pull request
Oct 27, 2025
…lity (#1660) ## What does this PR do? This PR implements scoped meta share mode for type forward/backward compaibility ## Related issues #202 ## Does this PR introduce any user-facing change? <!-- If any user-facing interface changes, please [open an issue](https://github.com/apache/incubator-fury/issues/new/choose) describing the need to do so and update the document if necessary. --> - [ ] Does this PR introduce any public API change? - [ ] Does this PR introduce any binary protocol compatibility change? ## Benchmark Perf increased from `1900102.586` to `2430410.064` ``` Before: Benchmark (bufferType) (objectType) (references) Mode Cnt Score Error Units fury_deserialize array MEDIA_CONTENT false thrpt 10 2734151.212 ± 253921.628 ops/s fury_deserialize_compatible array MEDIA_CONTENT false thrpt 10 1900102.586 ± 62176.872 ops/s furymetashared_deserialize_compatible array MEDIA_CONTENT false thrpt 10 3011439.327 ± 260518.752 ops/s After: Benchmark (bufferType) (objectType) (references) Mode Cnt Score Error Units fury_deserialize array MEDIA_CONTENT false thrpt 10 2661186.814 ± 279377.198 ops/s fury_deserialize_compatible array MEDIA_CONTENT false thrpt 10 2430410.064 ± 164165.865 ops/s furymetashared_deserialize_compatible array MEDIA_CONTENT false thrpt 10 3098083.064 ± 259391.053 ops/s ``` Size decreased from **732 to 577**: ``` Before 2024-05-30 01:00:49 INFO FuryState:157 [fury_deserialize_compatible-jmh-worker-1] - ======> Fury | MEDIA_CONTENT | false | array | 732 | After 2024-05-30 12:57:00 INFO FuryState:157 [fury_deserialize_compatible-jmh-worker-1] - ======> Fury | MEDIA_CONTENT | false | array | 577 | ``` The
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
before:(Bug found)

after:

in iphone
in ipad mini

in ipad pro

Desktop:
