Похожие чаты

This is a super dumb basic question but my google-foo

is failing me.

I want like, a basic text writer utility that writes to an underlying io.Writer

I want to avoid using fmt.Fprintx. I don't want to use formatting directives. I want to write exactly what I'm going to write idealy. Something like

writer.WriteInt(12)

Is that in the stdlib? Or do people use a lib for that

16 ответов

31 просмотр

What do you want WriteInt to do? Write the characters or write 4 bytes representing the actual integer value?

Eli-Davis Автор вопроса
Thomas
What do you want WriteInt to do? Write the charact...

Write the characters, specifically I want a "text based" writer. So this logic applies for floats as well

Eli-Davis Автор вопроса

pretty happy with this. Def recommend making a custom writer to avoid fprintf formatting directives if speed is a concern. Expecting 3x speedup for writing obj files.

Eli-Davis Автор вопроса
Павλо 🇺🇦
https://pkg.go.dev/fmt#Fprint

Great question! Fprint is still slower. Fprint also doesn't let you specify how you want stuff like floats formatted.

probably not noticable at all 🙂

Roman Sharkov
probably not noticable at all 🙂

and seems to consume about-the-least memory per op

Eli-Davis Автор вопроса
Roman Sharkov
fastest writer is hand-written writer

scale this up to millions of writes... signifigant

Eli-Davis Автор вопроса

scale this up to millions of writes... signifigant

Eli-Davis Автор вопроса

scale this up to millions of writes... significant

Eli-Davis Автор вопроса
Eli Davis
scale this up to millions of writes... significant

then it's part of your hot path and it does matter

Eli-Davis Автор вопроса
Eli Davis
?

I meant it does matter, the optimization is justifiable 🙂

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта