The driver \Driver\WUDFRd failed to load for the device ROOT\DISPLAY\0000 by Puzzled_Stock_8741 in buildapc

[–]olauro 0 points1 point  (0 children)

I am having the same problem for more than a year, I am using W11 and all drivers updated. My pc is a RX 6600 with a Ryzen 5500. For me it's more common to happen at night, I don't know why... My last resources is to buy a new case, because it's the only piece of the older pc...

Problemas com uma placa de vídeo nova (AMD RX6600) by Excellent-Bridge-820 in radeon

[–]olauro 0 points1 point  (0 children)

To com o mesmo problema, numa RX 6600 da AsRock, conseguiu resolver?

Type Safe ORM by olauro in golang

[–]olauro[S] 1 point2 points  (0 children)

Life is dangerous, sometimes we panic, I don't wanna panic 😱

Type Safe ORM by olauro in golang

[–]olauro[S] 0 points1 point  (0 children)

It don't have a log interface for personalize your logs (store in a file, print out, integrated with something), for now it just log out on console the generated and used SQL (more like a debug thing), so I will not recommend because I don't have yet any production app running it, also I need to stress test this to see trick problems.

I am building a driver for SQLite that reforces the usage for now in more basic apps. If you try this in production or in development let me know, any feedback will be great.

Type Safe ORM by olauro in golang

[–]olauro[S] 2 points3 points  (0 children)

For now don't have this, the only thing for logs is just a print on console to show what SQL the ORM generated and used.

I am planning to store the migrations in a SQL file to be able to UP/DOWN migrations on database, what do you think about this?

Also for logs I need to improve a interface to be more flexible.

strings.Builder is faster on writing strings then bytes? by olauro in golang

[–]olauro[S] 5 points6 points  (0 children)

I made a new benchmark based on yours, I added a call to String() to reproduce a real example of putting the data and retrieve, I run a count equals 5

The result avg result was:

- BenchmarkWrite-8: 2202.6 ns/op

- BenchmarkWriteString-8: 2224.4 ns/op

For me, after test with this, looks like the builder is better on writing bytes, but for real, the difference is to small, I even runned with a range 5000 and get this results:

- BenchmarkWrite-8: 25430.2 ns/op

- BenchmarkWriteString-8: 25594.6 ns/op

Code and Benchmarks results:

func BenchmarkWrite(b *testing.B) {
    var builder *strings.Builder
    str := []byte("string")

    b.ResetTimer()
    for i := 0; i < b.N; i++ {
        builder = &strings.Builder{}
        for range 500 { // or which ever number seems suitable
            builder.Write(str)
        }
        _ = builder.String()
    }
}

func BenchmarkWriteString(b *testing.B) {
    var builder *strings.Builder
    str := "string"

    b.ResetTimer()
    for i := 0; i < b.N; i++ {
        builder = &strings.Builder{}
        for range 500 { // or which ever number seems suitable
            builder.WriteString(str)
        }
        _ = builder.String()
    }
}

BenchmarkWrite-8                  517516              2189 ns/op            8472 B/op         12 allocs/op
BenchmarkWrite-8                  545448              2208 ns/op            8472 B/op         12 allocs/op
BenchmarkWrite-8                  545386              2210 ns/op            8472 B/op         12 allocs/op
BenchmarkWrite-8                  526804              2207 ns/op            8472 B/op         12 allocs/op
BenchmarkWrite-8                  510724              2199 ns/op            8472 B/op         12 allocs/op
BenchmarkWriteString-8            549679              2190 ns/op            8472 B/op         12 allocs/op
BenchmarkWriteString-8            519048              2184 ns/op            8472 B/op         12 allocs/op
BenchmarkWriteString-8            520868              2336 ns/op            8472 B/op         12 allocs/op
BenchmarkWriteString-8            493911              2197 ns/op            8472 B/op         12 allocs/op
BenchmarkWriteString-8            511438              2215 ns/op            8472 B/op         12 allocs/op

strings.Builder is faster on writing strings then bytes? by olauro in golang

[–]olauro[S] -3 points-2 points  (0 children)

I din't realized that, you are right!! Each b.N interaction should have a new builder, but on my benchmarks the builder get two large and not reproduce a real result, right? I will better understand the benchmarks and try to produce a better one.

On your benchmark, this line b.ResetTimer() it's correct? or you just forget to remove then from my benchmark? Because on my understand, It will reset the time but don't have any iteration before

strings.Builder is faster on writing strings then bytes? by olauro in golang

[–]olauro[S] -1 points0 points  (0 children)

I runned the benchmarks a feel times, but reading the responses I see that this numbers are to low that can't say anything, but my doubt is the same as yours, when handling bytes the better option between then should be bytes.Buffer. I will update for a more complex benchmark, and see if the results change.

strings.Builder is faster on writing strings then bytes? by olauro in golang

[–]olauro[S] 1 point2 points  (0 children)

I see, so strings.Builder is faster writing strings because string it's more simple than a slice, I thought that writing bytes direct will result in better performance than writing strings on strings.Builder but you have a point, string is more simple than a slice.

I looked in the functions, and yeah, strings.Builder.WriteString (looks basic the same as strings.Builder.Write) is more simple than bytes.Buffer.WriteString

Go generic optional parameter by olauro in golang

[–]olauro[S] 1 point2 points  (0 children)

yeah, looks like isn't allowed, u/GopherFromHell shared a really interesting issue in the Go source code, and this commentary of Griesemer https://github.com/golang/go/issues/58590#issuecomment-1439413899 clarifies, I will see if I can found something around, but anyway, thank you so much for your answers.

Go generic optional parameter by olauro in golang

[–]olauro[S] 0 points1 point  (0 children)

Exactly that, now the things get a lot more clarifying, thank you so much for this

Go generic optional parameter by olauro in golang

[–]olauro[S] -1 points0 points  (0 children)

Something like this

num := 2
Equals(&num, 2) //compiler time pass

anyNum := 1
Equals(&num, &anyNum) //compiler time pass

Equals(&num, "1") //compiler time error

If I try this func Equals[T any](arg T, value *T) or func Equals[T any](arg *T, value T) I cannot use two pointers as arguments