Comments (7)
明白了,谢谢! 那在jupyter里手动执行下db.write_immediately()也是合理的,或许在README里可以说明下。
from flaxkv.
确实如此,当写入的数据大小没有达到db.MAX_BUFFER_SIZE
时,数据依旧在内存中的,因此如果期望jupyter 中(或在python进程没有结束之前) 即时写入磁盘,比较方便的方式是手动触发.write_immediately()
方法:
db = dictdb('./test_db')
db[(1, 2, 3)] = [1, 2, 3]
db.write_immediately()
也可以通过设置db.MAX_BUFFER_SIZE=1
对每一次数据更新都进行磁盘写入(写入性能很高,不必过于担心);
或是通过设置自动保存的时间间隔db._COMMIT_TIME_INTERVAL
(单位:秒)对内存中的缓存数据进行定期磁盘写入。
from flaxkv.
但是在.py文件中执行相同的程序时,就没有这个问题,写入的数据大小是一样的。 是不是还存在别的原因?
from flaxkv.
是会在py文件执行完毕,退出程序前执行写出操作吗? 而jupyter文件没有这一过程
from flaxkv.
是会在py文件执行完毕,退出程序前执行写出操作吗? 而jupyter文件没有这一过程
没错
from flaxkv.
This issue is stale because it has been open for 30 days with no activity.
from flaxkv.
在版本v0.2.3
之后加入了写入监控,即在触发更新数据的相关操作后都会尽快写入,这意味着即使在jupyter中也不必再手动执行db.write_immediately()
了。
from flaxkv.
Related Issues (12)
- 远程连接时报错 HOT 2
- Feat: Move `RemoteDictDB` into `BaseDBDict`
- Feat: Retrieve data to memory HOT 2
- Feat: Supports pandas Dataframe as the value
- Feat: Use streaming when retrieving from remote db
- Thanks
- Feat: Optimizing the for loop during remote calls HOT 2
- Feat: The `keys()` , `values()` , `items()` method will returns an iterator
- 会增加返回某个前缀的迭代器么?键空间的支持 HOT 8
- 两个python文件,一个写入db,一个读取db,实时读写问题 HOT 1
- Feat: 考虑使用单例模式
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 flaxkv.