Search
Setup for Free
S
Silk.NET
•
5y ago
Deleted User
due to insufficient buffer
due to insufficient buffer
Silk.NET
Join
A Discord server for the Silk.NET - your one-stop-shop for high-speed .NET multimedia, graphics, and compute. FOSS.
1,788
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
D
Deleted User
OP
•
5/6/21, 11:27 AM
but I guess those are invalid for ANSI anyways
P
Perksey
•
5/6/21, 11:27 AM
yeah
P
Perksey
•
5/6/21, 11:27 AM
that
's not a valid ANSI string
P
Perksey
•
5/6/21, 11:28 AM
so that
's an expected fail
D
Deleted User
OP
•
5/6/21, 11:28 AM
well P
/Invoke can do it
D
Deleted User
OP
•
5/6/21, 11:28 AM
in 130 fucking ns
P
Perksey
•
5/6/21, 11:29 AM
¯\_(ツ)_/¯
P
Perksey
•
5/6/21, 11:29 AM
find out how they
're doing it i guess
D
Deleted User
OP
•
5/6/21, 11:30 AM
I would bet it
's compiler magic
D
Deleted User
OP
•
5/6/21, 11:30 AM
there is no way anyone can runtime convert 586
*
�
�
(a 3
-byte UTF8 char
) in 6
.18 ns
D
Deleted User
OP
•
5/6/21, 11:30 AM
like I
'm sorry but that
's just impossible
P
Perksey
•
5/6/21, 11:31 AM
meh could be done
P
Perksey
•
5/6/21, 11:31 AM
dunno how
P
Perksey
•
5/6/21, 11:31 AM
but it doesn
't sound that far
-fetched
T
themixedupstuff
•
5/6/21, 11:32 AM
Seems plausible
. Have you spotted the bottleneck yet
?
T
themixedupstuff
•
5/6/21, 11:32 AM
The number of bytes on the character doesn
't really affect it
, as you only need to read the first character to find how many bytes it is
.
D
Deleted User
OP
•
5/6/21, 11:33 AM
well I just don
't know another way of doing this
D
Deleted User
OP
•
5/6/21, 11:33 AM
we just call into normal system code
D
Deleted User
OP
•
5/6/21, 11:33 AM
which looks highly optimized
D
Deleted User
OP
•
5/6/21, 11:34 AM
but not 6 ns for almost 600 chars
D
Deleted User
I would bet it's compiler magic
D
Deleted User
OP
•
5/6/21, 11:35 AM
Check with a runtime string
.
:
)
D
Deleted User
OP
•
5/6/21, 11:36 AM
looking at the JIT output rn
D
Deleted User
OP
•
5/6/21, 11:36 AM
I
'd be somewhat surprised if it was roslyn magic
D
Deleted User
OP
•
5/6/21, 11:36 AM
jit magic seems more likely
T
themixedupstuff
•
5/6/21, 11:37 AM
Really depends on where the string you are testing is
.
D
Deleted User
OP
•
5/6/21, 11:39 AM
wdym
?
T
themixedupstuff
•
5/6/21, 11:40 AM
What is the source of your string
.
D
Deleted User
OP
•
5/6/21, 11:40 AM
a field
?
D
Deleted User
OP
•
5/6/21, 11:40 AM
but not sure why that really matters
T
themixedupstuff
•
5/6/21, 11:41 AM
Well
, the compiler could be emitting the converted string into the text section at compile time
.
T
themixedupstuff
•
5/6/21, 11:41 AM
Which would me no conversion is taking place at runtime
.
D
Deleted User
OP
•
5/6/21, 11:41 AM
oh
, right
, but I
'd think that
's unlikely
T
themixedupstuff
•
5/6/21, 11:42 AM
Murphy laws says otherwise
, I would look into it
.
D
Deleted User
OP
•
5/6/21, 11:42 AM
of course
. just going down the list of possible reason right now
D
Deleted User
OP
•
5/6/21, 11:42 AM
(also looking at the IL
, I don
't notice anything like that immediately
)
T
themixedupstuff
•
5/6/21, 11:43 AM
IL isn
't what really runs
, you would have to check out the native code
.
P
Perksey
•
5/6/21, 11:43 AM
yeah fire up windbg
D
Deleted User
OP
•
5/6/21, 11:43 AM
yeah that
's my step two
D
Deleted User
OP
•
5/6/21, 11:43 AM
why windbg
D
Deleted User
OP
•
5/6/21, 11:44 AM
just JIT disasm
P
Perksey
•
5/6/21, 11:44 AM
idk i just find it the easiest way to disassemble apps as they
're running
D
Deleted User
OP
•
5/6/21, 11:44 AM
You are not using a debug build to dump your JIT
?
T
themixedupstuff
IL isn't what really runs, you would have to check out the native code.
D
Deleted User
OP
•
5/6/21, 11:44 AM
but if roslyn did anything here it would be visible in IL
P
Perksey
•
5/6/21, 11:44 AM
P
/Invoke shims aren
't a roslyn thing
D
Deleted User
OP
•
5/6/21, 11:44 AM
they used to be
P
Perksey
•
5/6/21, 11:44 AM
they never were
D
Deleted User
OP
•
5/6/21, 11:44 AM
I thought so
D
Deleted User
OP
•
5/6/21, 11:45 AM
anyways
, if there was some compile time optimization it would be in IL
D
Deleted User
OP
•
5/6/21, 11:45 AM
if there is nothing in IL the compiler did nothing
D
Deleted User
OP
•
5/6/21, 11:45 AM
so then it has to be JIT
Next page