Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

二进制数据文件体积优化 #4

Open
hungtcs opened this issue Dec 18, 2020 · 2 comments
Open

二进制数据文件体积优化 #4

hungtcs opened this issue Dec 18, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@hungtcs
Copy link
Owner

hungtcs commented Dec 18, 2020

目前采用的二进制数据文件大小约为357KB
这个体积对于通过网络加载的浏览器来说还是比较耗时的,通过参考其他相关资源和资料,
目前的数据还是可以进一步精简的,目前临时的方案为,保留必要的特征数据,
删除可以通过计算推导的数据。数据结构暂定如下。

月份数据

变量 解释 意义 长度(bit) 备注
losm long or short months 12个月的大小 12
lemo leap month 闰月 4
lems (L)leap month long or short 闰月是大还是小 1
fdgd first day of gregorian date 正月初一对应的公历日 5
fdgm first day of gregorian month 正月初一对应的公历月 4
fdgy first day of gregorian year 正月初一对应的公历年 8 减去1900得到的数字
0x F    F    F    F    F    F    F    F    F    F
0b|0000 0000|0000 0000|0000 0000|0000 0000|0000 0000|
   losm           lemo L       fdgd   fdgm fdgy

一年的数据占5B,1901年至2100年共5 * (2100 - 1901)995B

@hungtcs hungtcs added the enhancement New feature or request label Dec 18, 2020
@hungtcs hungtcs self-assigned this Dec 18, 2020
@hungtcs
Copy link
Owner Author

hungtcs commented Dec 18, 2020

可以使用此脚本修改Github字体实现对齐 https://gist.github.com/hungtcs/819a64fa9e6bfa37ce391f29765acfa3

@Artoria2e5
Copy link

Artoria2e5 commented Aug 15, 2021

暴力一点的话 fdgy 也可以省掉,靠数组下标推?另外我怎么觉得该是 gyfd (gregorian year of first day)…

节气的计算是按照 http://farside.ph.utexas.edu/Books/Syntaxis/Almagest/node36.html 这种来?有个库 https://github.com/Fabiz/MeeusJs 挑挑拣拣多半够用。

感觉应该先用 json 表示这个格式做个不用怎么动脑的原型……肯定会比原本小很多就是(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants