Giter VIP home page Giter VIP logo

Comments (5)

ernado avatar ernado commented on May 24, 2024

Agree. Internally there are already a de-serialization, but uint64 values are not available to user.

Probably we can count some very fast hash on those values (or just sum them up?) on all values to force de-serialization?

Not sure how to deal with it in general.

from ch-bench.

zhicwu avatar zhicwu commented on May 24, 2024

I think we probably should avoid extra calculation, which might be unfair for programming languages like Java and Python :p i guess it's sufficient enough to call driver-specific method to make sure bytes were converted to uint64, either explicitly or implicitly. For Java, below snippets will do the work.

https://github.com/go-faster/ch-bench/blob/c2627b1d0fa1a8abc7d3560816d3b919b983600b/ch-bench-java/Main.java#L60

https://github.com/go-faster/ch-bench/blob/c2627b1d0fa1a8abc7d3560816d3b919b983600b/ch-bench-java/Main.java#L88-L90

https://github.com/go-faster/ch-bench/blob/c2627b1d0fa1a8abc7d3560816d3b919b983600b/ch-bench-java/Main.java#L104-L106

from ch-bench.

ernado avatar ernado commented on May 24, 2024

AFAIK ch-bench-official is doing it implicitly here:
https://github.com/go-faster/ch-bench/blob/c2627b1d0fa1a8abc7d3560816d3b919b983600b/ch-bench-official/main.go#L30-L33

Same as uptrace:
https://github.com/go-faster/ch-bench/blob/c2627b1d0fa1a8abc7d3560816d3b919b983600b/ch-bench-uptrace/main.go#L24-L28

Personally I would prefer something like that:

var count int
for rows.Next() {
	var value uint64
	if err := rows.Scan(&value); err != nil {
		return err
	}
	count++
}

But this will dramatically increase time from 1.388s to 22.567s which is unfortunate (but actually more realistic). This would not affect ch-go and chconn, because they don't rely on reflection.

WDYT?

from ch-bench.

zhicwu avatar zhicwu commented on May 24, 2024

Thanks @ernado. It looks like rows.Next() is mainly about reading blocks according to here, while rows.Scan is the deserialization we're talking about - see here.

Yes, I think the change is more accurate although it will increase the time - perhaps the author has better idea.

By the way, I think besides UInt64, we probably should also consider other data types like String, DateTime and Array(Java is extremely slow for processing nested types) etc.. Below is something I tried earlier but never got enough time to fill out all those tiny cells :p
image

from ch-bench.

ernado avatar ernado commented on May 24, 2024

we probably should also consider other data types like String, DateTime and Array

never got enough time to fill out all those tiny cells :p

I've tried to do it, but with same result - never got enough time :D

from ch-bench.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.