Skip to content
This repository was archived by the owner on Dec 3, 2019. It is now read-only.
This repository was archived by the owner on Dec 3, 2019. It is now read-only.

commit 90e4194 causes massive performance degradation #179

Open
@njeuk

Description

@njeuk

Hi, I'm seeing a massive performance degradation with the commit 90e4194 .
I suspect Postres handles with the numeric conversions badly -- but not really sure that is the root cause yet, or how to work around the issue.

Sample code:

object TestPerf {
  def main(args: Array[String]): Unit = {
    val configuration = URLParser.parse("jdbc:postgresql://someaddress/somedb?user=someuser&password=topsecret")
    val connection: Connection = new PostgreSQLConnection(configuration)
    Await.result(connection.connect, 50.seconds)
    val startTime = LocalDateTime.now()
    for (i <- Range(1, 1000)) {
      val id = Random.nextInt(3000000)
      Await.result(connection.sendPreparedStatement("update companies set name = name where id = ?", Array(id)), 10.seconds)
      val elapsed = java.time.Duration.between(startTime, LocalDateTime.now())
      println(s"$i : ${elapsed.toMillis / i} average mSec per update")
    }
    connection.disconnect
  }

With 90e4194 applied, I get a response like:

[info] Running com.example.TestPerf 
1 : 1611 average mSec per update
2 : 1463 average mSec per update
3 : 1526 average mSec per update
4 : 1438 average mSec per update

without:

[info] Running com.example.TestPerf 
1 : 68 average mSec per update
2 : 67 average mSec per update
3 : 61 average mSec per update

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions