[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to calculate the size of string in bytes?
From: |
Sam Halliday |
Subject: |
Re: how to calculate the size of string in bytes? |
Date: |
Wed, 19 Aug 2015 01:57:36 -0700 (PDT) |
User-agent: |
G2/1.0 |
On Tuesday, 18 August 2015 22:47:44 UTC+1, Stefan Monnier wrote:
> > It seems somewhat wasteful to encode msg (to find its length) just
> > to let process-send-string encode again -- perhaps there's a better
> > idiom around for that.
>
> Yup: communicate with the process using bytes rather than chars!
>
> I.e. set the process's coding system to binary.
>
> Then you just need to call (encode-coding-string msg coding-system) once
> to get the bytes and you send them as is: they won't be re-encoded.
>
>
> Stefan
Heh, that's actually a very good suggestion. We'll keep that in mind if this is
ever a performance bottleneck. We're hoping to move the ENSIME protocol (based
on SWANK) over to S-Expressions over WebSockets which will mean we can just
delete all this code.
- Re: how to calculate the size of string in bytes?, (continued)
- Re: how to calculate the size of string in bytes?, Eli Zaretskii, 2015/08/18
- Re: how to calculate the size of string in bytes?, tomas, 2015/08/18
- Re: how to calculate the size of string in bytes?, Eli Zaretskii, 2015/08/18
- Re: how to calculate the size of string in bytes?, tomas, 2015/08/18
- Re: how to calculate the size of string in bytes?, Eli Zaretskii, 2015/08/18
- Re: how to calculate the size of string in bytes?, tomas, 2015/08/18
- Re: how to calculate the size of string in bytes?, Eli Zaretskii, 2015/08/18
- Re: how to calculate the size of string in bytes?, tomas, 2015/08/18
Re: how to calculate the size of string in bytes?, Stefan Monnier, 2015/08/18
Message not available
Message not available
Re: how to calculate the size of string in bytes?, Eli Zaretskii, 2015/08/18