Batch Seeding Performance
See original GitHub issueI’m currently running into issues while trying to use batch to seed my database. I have collections of around 50K records, which caused me to run into memory issues I assume are mentioned in #308.
Since I’m using batch and not sync I added my own limit of around 1000 to get around the memory issue. This however has lead to very slow initial seeding performance (taking minutes to populate fully).
#403 mentions using the new flag to achieve the 5K batch size, but I’m not sure if they’ve run into the slow seeding performance or not.
Anybody had to deal with this case, or the general case of populating watermelon with many records?
Issue Analytics
- State:
- Created 4 years ago
- Comments:28 (20 by maintainers)
Top Results From Across the Web
Seeding Studies For Crystallization
Crystallization seeding is important in producing a crystal product of consistent quality. Seeding is used to control supersaturation.
Read more >Design and simulation for seeding performance of high ...
Design and simulation for seeding performance of high-speed inclined corn metering device based on discrete element method (DEM).
Read more >Seeding: A simple but effective method for crystallization ...
Sieve fractions- A batch is sieved to deliver a fraction and used to seed many batches. Selecting the seed source depends on the...
Read more >Seeding Technique in Batch Crystallization
This paper describes effectiveness of a “short-time” batch operation for obtaining a metastable crystalline phase (L-glutamic acid, α-form) ...
Read more >Seeding policy in batch cooling crystallization
The effect of seeding in batch cooling crystallization is ... Seed concentration is shown to play a key role for crystallizer performance.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@BruceSuperProgramer yes and no. when inserting records, most time is spent passing data between JS and native, so there isn’t a lot of opportunity for multithreading. Try out the latest v23 pre-release with jsi mode turned on - you should see batch being >2x faster. It also rearchitects batching such that moving much of the processing to a separate thread (in a future release) should be possible and practical to do.
@radex, wouldn’t using the
batchfunctionality within swift still have the performance issues, as @esbenp noted that the bottleneck is within theNative.batchcall?What about the idea of pre-building a
.dbSQLite file and somehow loading that in on the native side, as is seen here.Do you think that would work with how watermelon needs its own models and such? I’m optimistically thinking it would be possible to load in a
.dbfile as long as the structure adheres to what watermelon would create via all theModelobjects?EDIT:
If the above would work, then we could look into being able to pass a path to db file, instead of just a db name as is currently the case.
I’m thinking of change along the lines of:
DatabaseBridge.initialize()DatabaseBridge.initialize()DatabaseDriver.swiftwhich takes in the pathDatabaseDriver.swiftthen instantiatesDatabase.swiftby passing path along, instead of assigning it togetPath(dbName: dbName)Thoughts on this?