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.

discriminators performance

See original GitHub issue

Hello,

Im using this kind of mapper :

this.mapper = JdbcMapperFactory
                        .newInstance()
                        .addKeys("id")
                        .discriminator(A.class,
                                "type",
                                ResultSet::getString,
                                builder-> builder.discriminatorCase("TYPEA1", A1.class)
                                builder-> builder.discriminatorCase("TYPEA2", A2.class)
                                builder-> builder.discriminatorCase("TYPEA3", A3.class)
                                builder-> builder.discriminatorCase("TYPEA4", A4.class)
                                .......
                        )
                        .discriminator(B.class,
                                "b_type",
                                ResultSet::getString,
                                builder-> builder.discriminatorCase("TYPEB1", B1.class)
                                builder-> builder.discriminatorCase("TYPEB2", B2.class)
                                builder-> builder.discriminatorCase("TYPEB3", B3.class)
                                builder-> builder.discriminatorCase("TYPEB4", B4.class)
                                ........
                        )
                .newMapper(A.class);

I have a resultset which contains 100K row with 7 columns.

Here is the code mapping rs to list :

		String query = "....";
		L.info("execute : {}", query);
		long start = System.currentTimeMillis();
		List objects = new ArrayList();
		try (PreparedStatement ps = this.datasource.getConnection().prepareStatement(query);
				ResultSet rs = ps.executeQuery()) {
			L.info("execute in {} ms", System.currentTimeMillis() - start);
			start = System.currentTimeMillis();
			objects = mapper.stream(rs).collect(Collectors.toList());
			L.info("mapped in {} ms", System.currentTimeMillis() - start);
		} catch (SQLException e) {
			L.error("impossible to map the result set", e);
		}

my timings are : execute in 288 ms mapped in 5103 ms

How can I help you troubleshoot this ?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:28 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
arnaudrogercommented, Nov 7, 2018

yep looks like it, I should be able to fix that.

Benchmark                                             Mode  Cnt      Score     Error  Units
DiscriminatorBenchmark.testNoDiscriminator            avgt    5     48.025 ±   5.033  ms/op
DiscriminatorBenchmark.testWithDiscriminator          avgt    5     93.178 ±   4.201  ms/op
DiscriminatorBenchmark.testWithDiscriminatorWithKeys  avgt    5  10041.184 ± 841.473  ms/op
0reactions
n1b0rcommented, Nov 16, 2018

thanks a lot for your support !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Performance evaluation of differential and discriminator ...
The performance of CPM systems is analyzed for differential and discriminator detection. An additive white Gaussian channel is assumed. The detectors make ...
Read more >
Ways to improve GAN performance | by Jonathan Hui
It introduces randomness that makes the discriminator harder to overfit itself. Feature matching is effective when the GAN model is unstable during training....
Read more >
Discriminators of high performing schools and low performing ...
Ten high schools each from high Mathematics performance and low Mathematics performance groups were the study area. The study was conducted in ...
Read more >
Jamar Discriminator | Performance Health
The perfect sensation testers for evaluating static and moving one and two-point discrimination. This discriminator set includes two disks for testing and ...
Read more >
A high-performance, low-cost, leading edge discriminator
A high-performance, low-cost, leading edge discriminator has been designed with a timing performance comparable to state-of-the-art, commercially available.
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