question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I’m trying to connect to the H2 database on an embedded device.

The connection using

Database.connect("jdbc:h2:~/testdb;DB_CLOSE_DELAY=-1", driver = "org.h2.Driver", user = "root", password = "")

takes about 7s to create/open a database, but the connection using another library, for example kotliquery

val create = measureTimeMillis {
            sess = sessionOf("jdbc:h2:~/testdb;DB_CLOSE_DELAY=-1", "root", "")
            sess.execute(queryOf("CREATE TABLE IF NOT EXISTS RandomText(ID INT PRIMARY KEY auto_increment, text VARCHAR(15));"))
        }

takes about 2s.

Any reason for that overhead and is there any way to speed it up?

We’re running the program and the database on an embedded device called Colibri IMx6, and the speedup would greatly help us.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
MGlolenstinecommented, Feb 3, 2020

Sure thing! I’m on it! @Tapac new commit has been pushed! This is an example output from my PC

h2 database creation #2 took 1402 ms
Filling database with 50 random 15 long strings took 51 ms
There's 50 text lines in the database!
Number of databases: 1
h2 database creation #1 took 381 ms
Filling database with 50 random 15 long strings took 61 ms
There's 50 text lines in the database!
Number of databases: 1
h2 database creation #3 took 37 ms
Filling database with 50 random 5 long strings took 13 ms
Filling database with strings took 22 ms

and this is the output from Colibri imx6

h2 database creation #2 took 13169 ms
Filling database with 50 random 15 long strings took 270 ms
There's 50 text lines in the database!
Number of databases: 1
h2 database creation #1 took 873 ms
Filling database with 50 random 15 long strings took 378 ms
There's 50 text lines in the database!
Number of databases: 1
h2 database creation #3 took 114 ms
Filling database with 50 random 5 long strings took 168 ms
Filling database with strings took 171 ms
0reactions
MGlolenstinecommented, Feb 15, 2020

Thanks for spending your time on this and providing insightful information!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Slow Exposure (@theslowexposure) • Instagram photos and ...
a space provoking careful consumption by @elizacamillaedwards · 348 posts · 2,535 followers · 1,634 following.
Read more >
Slow Exposure - YouTube
Provided to YouTube by TuneCoreSlow Exposure · AJ HamiltonSlow Exposure ℗ 2022 AJ HamiltonReleased on: 2022-10-31Auto-generated by YouTube.
Read more >
Product | MDP | Slow Exposure Stripe 001 - Maharam
Slow Exposure Stripe is a photocollage of London's Brick Lane at night. By slowing the camera's shutter speed, the neon signs that light...
Read more >
Imaging Products | DSLR Camera Basics | Shutter Speed
Setting Exposure: Shutter Speed and Aperture ... exposed to light; the slower the shutter speed, the longer the time the image sensor is...
Read more >
Slow Exposure - Atlas of the Future
Eliza explains that Slow Exposure will sharpen its focus on issues that are linked to, and ultimately an inherent part of, sustainability: “I've ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found