Похожие чаты

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 ответов

26 просмотров

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 🙂

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

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

Всем привет! Имеется функция: function IsValidChar(ch: UTF8Char): Boolean; var i: Integer; ValidChars: AnsiString; begin ValidChars := 'abcdefghijklmnopqrstuvwxyzABCDE...
Евгений
44
For all those that keep asking why no pump? why this ? and why that...? Please close ur ewt chart and open 2 others - TOTAL (total mc) and BTC.D (btc dominance). Maybe BTC a...
Inn3r_G
19
"Since pnut can flip FTM easily, I'm swapping my FTM to pnut and hoping for a easy x5-x10" Perfect recipe for disaster. NFA but chances are, you'll end up as exit liquidity ...
C. A.
7
да кстати заметил всюда почему то всех сюда прёт, ни в одном чате столько ботов не прёт как сюда.. Может чота надо доработать?
REDis
15
AMD status update? No longer in the plan but something might be around the corner later on Chinese partner? No longer in the plan. This market does not seem to be the top ...
Ben
6
I get confused when people talk about the ‘bull market’ and the ‘next bull market’ as if anyone really has a clue what’s really going on in the world. First of all - there i...
Shah
1
Ready for some fun AND a chance to win TKO Tokens? Join us for exciting minigames in our Telegram group! 🕒 Don’t miss out—games start on today 25 October 2024, at 8 PM! Ge...
Milkyway | Tokocrypto
255
Всем привет, я тут короче оторвал кусок от рут-раздела и сделал свап, перезаписал fstab, загружаюсь и меня перекидывает в дебаг-шелл. Вижу ошибки бтрфс: Device total_bytes sho...
&[SirJiga] Jiga
9
Добрый день, подскажите, пожалуйста, по проблеме. Сегодня на работе утром обнаружилось что по рдп подключиться не получается к серверу 2022. В серверную зашел - на системно...
srv
19
И никого не интересует какие пакеты кто использует. ((% Заходишь на сайт симфони и видишь поддержку Украины - по законам РФ это ж экстремизм. Только никто не отказывается от с...
Am Ambrion
11
Карта сайта