Comments (6)
Hi @Destanci, i would like to work on this task!
is this the work flow you are expecting from async method to do?
getAll() method called
Stopwatch started
getStore() awaited
[STOPWATCH] Store get time: X milliseconds
getAllAsync() awaited
[STOPWATCH] Database result time: Y milliseconds
getAll() method completed
from objectbox-dart.
method is just fine with sync or async doesnt really matters. My question is, is there anything wrong with the async functions? no? then why it tooks 100times more time to get the data with async?
from objectbox-dart.
When i see the code Async the code line var entities = await store.box().getAllAsync(); is using await function which will wait until it gets the result and i thing you are using getall() function in async code pls check. I may be wrong!
this may be a solution for the entities variable await usage:
var entitiesFuture = store.box<TEntity>().getAllAsync();
// Perform other tasks while waiting for getAllAsync to complete.
// Now, await the result of getAllAsync when needed.
var entities = await entitiesFuture;
from objectbox-dart.
nah, measured the time outside of the function too. changing the position of awaiting does not make sense at all. since if you didnt start to await that Future wont start working right?. Also nothing else to do between that 2 lines.
from objectbox-dart.
@Destanci As documented, the async methods spawn a worker isolate to complete the box operation. That naturally takes some more time than directly calling the database API.
However, 2 seconds vs. 2 microseconds seem rather long. As you mentioned it, did you test in release mode? This is where we also measure performance and did not find that much of a penalty for using the async variants.
Note: @vamsikrishnacse is not associated with ObjectBox. I've also hidden the comments of that discussion.
from objectbox-dart.
Without additional information, we are unfortunately not sure how to resolve this issue. Therefore this issue has been automatically closed. Feel free to comment with additional details and we can re-open this issue.
from objectbox-dart.
Related Issues (20)
- namespace not specified. HOT 2
- Data Visualization Tool HOT 2
- Reordering list HOT 5
- Missing tests examples for Flutter/Dart HOT 4
- macbook m2 virtual machine packaging windows linux cannot download the libs of the corresponding platform
- notOneOf() is missing in Dart API HOT 1
- generator error with retrofit HOT 1
- Dsym files not present in Release mode of ObjectBox Dart HOT 9
- this app add unauthorized charges to your mobile bill by registering for recurring charges HOT 4
- ObjectBox Admin with Docker not working in Windows HOT 2
- Query List<String> where element contains( 'part' ) HOT 2
- Unable to run unittests with objectbox HOT 6
- Bad state: ToOne relation field not initialized thrown when accessing target
- Direct change of an related object via the main saved obj. HOT 1
- $ in the property name eror in the objectbox.g.dart file HOT 2
- Error after upgrading: Unsupported operation: ObjectBox platform-specific library not compatible HOT 6
- Mac app was crashed by objectbox HOT 7
- ObjectBoxException on Windows with Flutter: "failed to create store: Incoming entity ID does not match existing UID" HOT 1
- JSON Serialization with relations HOT 2
- ObjectWithScore class not exported
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 objectbox-dart.