Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 17:32
    cdiwakar starred dotnet/corefx
  • 17:03
    shubhamranjan review_requested #41122
  • 17:03
    tarekgh commented #41124
  • 17:02
    tarekgh labeled #41124
  • 17:02
    tarekgh unlabeled #41124
  • 17:02
    tarekgh labeled #41124
  • 17:01
    Dotnet-GitSync-Bot labeled #41124
  • 17:01
    tarekgh opened #41124
  • 16:50
    Tratcher closed #41116
  • 16:50
    Tratcher commented #41116
  • 16:41
    tarekgh commented #41117
  • 16:41
    tarekgh milestoned #41117
  • 16:41
    tarekgh labeled #41117
  • 16:03
    shubhamranjan edited #41122
  • 16:02
    shubhamranjan synchronize #41122
  • 16:01
    shubhamranjan edited #41122
  • 15:44
    Gnbrkm41 commented #41123
  • 15:42
    Dotnet-GitSync-Bot labeled #41123
  • 15:42
    Gnbrkm41 opened #41123
  • 15:38
    fawdlstty commented #40725
Michał Zegan
@webczat
hi. what is generally faster? Span<T> or pointers? including cases like accessing an array through pointers when array was fixed.
Wraith2
@Wraith2
the answer is to profile your code and find out.
Michał Zegan
@webczat
I usually ask general answers like that without having any. for example I was wondering if span should replace most unsafe calls and if it is or may be faster than pointers?
Wraith2
@Wraith2
my recommendation is always to prefer safe over unsafe code. a lot of perf improvements in 3.0 stem from span usage. try it and see.
Michał Zegan
@webczat
well
would probably need to do specific tests trying to do the same with span and with pointers. I was just curious if span is faster than pointers or just something that can be as fast but remains safe contrary to pointers.
Michał Zegan
@webczat
also for example what non obvious problems can arise from doing unsafe? obvious ones are these that c programmers know about accessing things by pointers... Also there is this gc pinning stuff that span seems not to need, probably because it uses managed pointers whenever it can...
Cory Nelson
@scalablecory
Span tries to protect you, does bounds checking etc.
in some cases it can be optimized away
I would start with span and only use pointers if you see a perf issue
(and then measure again because maybe your change didn't improve anything)
masonwheeler
@masonwheeler

(and then measure again because maybe your change didn't improve anything)

This is the most important part!

Stephen A. Imhoff
@Clockwork-Muse
....This is why the most important part of TDD is that you first make sure you have a failing test.
Michał Zegan
@webczat
I understand that span is safer, that's the whole point. I was just wondering what is more unsafe in the unsafe code except the same things that are problematic in C language when using pointers. like accessing stuff over the bounds, accessing outright wrong addresses, accessing null, wrongly reinterpreting pointers, etc. also is span access to array faster than access to the same array directly, like when I am not doing things like slicing? or it is only a wrapper for the array in this case to make things universal? I know it does not require pinning the array.
Joe4evr
@Joe4evr
it's only a wrapper
Michał Zegan
@webczat
I believe that I now myself could make the managed array reference and store it in a field of an object? I believe the ByRef type is now public api? didn't look for it yet
Joe4evr
@Joe4evr
is it public? last I checked it was internal
Andy Ayers
@AndyAyersMS
ByReference<T> is internal and stack-only
Michał Zegan
@webczat
ah. whyyy :(
hmm ok you probably wouldn't be able to use it. I believe that the span accesses array using a byref, without even using the normal object reference.
and so it needs a managed pointer to the array that you probably cannot get normally
Joe4evr
@Joe4evr
exactly
Michał Zegan
@webczat
actually is access to an object reference faster than access via a managed pointer like that? or the only reason a managed pointer is used is so that you have one code path for wrapping a managed pointer via span, and wrapping an array via span? because managed pointers can point to unmanaged stuff contrary to object references... that is how I understand it
access to a managed pointer faster than object reference but nvm. I would guess there is no difference except managed pointers can contain more values
Michał Zegan
@webczat
hmm another stuff would be span vs arraysegment. my guess is that arraysegment has to add offset and do such stuff before each access to the array, contrary to span that directly wires to the array backing store
oh i love that stuff. :D
I probably just understood why the System.Memory cannot be used directly and must be converted to span, or at least that is what I think I saw
probably speed again, because if you would use Memory directly then it would be like ArraySegment...
Sebastien Deschamps
@BeRoots

I don't understand why I have InvalidOperationException: Role Customer does not exist error in my signin POST action. The user was inserted in the user table and this error is throw at line 43 of https://paste.ofcode.org/3sT46YfkQ54YecnZj6gf8n

My startup is like that https://paste.ofcode.org/8259fPkVATEesiji8iXqys
See my dbcontext too: https://paste.ofcode.org/SLhPikWLJmJGquePCbZdQ6

an idea?

Code build fine but the SignIn api method failed with this error. I have seed Roles at the db context creating ; the user is created too. But i don't have anything else into db tables...
Sebastien Deschamps
@BeRoots
I think is the seeding method for role is'nt the way to add role in app. ...
Wraith2
@Wraith2
you probalby want the aspnet channels
Sebastien Deschamps
@BeRoots
yes but i don't find it
ok thks for the channel ;)
Andy Ayers
@AndyAyersMS
The only difference between a managed pointer and an object ref is how GC handles it -- managed pointer is more expensive as GC must filter out non-GC heap pointers, and if the pointer is pointing in the GC heap, GC must "backtrack" to find the start of the object. For codegen, they behave more or less the same.
Wraith2
@Wraith2
anyone know where/if the docs for ref assembly generation are?
Mandar Sahasrabuddhe
@WinCPP

I am trying to create self-contained application for testing my local CoreFx build as per this documentation https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/dogfooding.md#option-2-self-contained

I have downloaded the nightly build and am doing the steps in 'self-contained' section (above link). However the dotnet restore gives me following errors. Appreciate help with the same. Thanks!!!

D:\Home\Test>dotnet restore
D:\Home\Test\Test.csproj : error NU1102: Unable to find package Microsoft.AspNetCore.App.Runtime.win-x64 with version (= 5.0.0-alpha1.19459.39)
D:\Home\Test\Test.csproj : error NU1102:   - Found 24 version(s) in dotnetcore-feed [ Nearest version: 3.0.0-preview4-19121-14 ]
D:\Home\Test\Test.csproj : error NU1102:   - Found 6 version(s) in nuget.org [ Nearest version: 3.0.0-preview9.19424.4 ]
D:\Home\Test\Test.csproj : error NU1102:   - Found 0 version(s) in Microsoft Visual Studio Offline Packages
D:\Home\Test\Test.csproj : error NU1102:   - Found 0 version(s) in CliFallbackFolder
  Restore failed in 138.21 ms for D:\Home\Test\Test.csproj.
Clinton Ingram
@saucecontrol
You probably just need to add the nightly package feed to your nuget.config. See step 4 in the prerequisites of the doc you linked above
Mandar Sahasrabuddhe
@WinCPP
@saucecontrol Step 4 says add the nightly package feed... still removing the others I still get the same error.
Clinton Ingram
@saucecontrol
ah, that doc only lists the dotnet-core feed. you need the aspnetcore feed as well: https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore/index.json
Mandar Sahasrabuddhe
@WinCPP
Actually, I realized the mistake. I started with using latest 5.x nightly build is 5.x series. Creation of new project using dotnet new console threw up list of templates to use, which I could not figure out. Hence used native 3.x to create project as mentioned in docs; but the generated csproj file had TargetFramework set to netcoreapp3.0. Changing that to netcoreapp5.0 resolved all the errors. Thanks!
FluentGuru
@FluentGuru
Hey @ReubenBond or anyone. Can you think of a reason why the InterfaceMethod property would be null in a grain filter?
Reuben Bond
@ReubenBond
@FluentGuru Wrong room :) InterfaceMethod isn't perfect, it's something that I'd like to improve soon. We can continue in https://gitter.im/dotnet/orleans
If you have a repro for it, though, please open an issue & I'll try to address it
Ahson Khan
@ahsonkhan
@Wraith2 regarding anyone know where/if the docs for ref assembly generation are? - this might help: https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/updating-ref-source.md
FluentGuru
@FluentGuru
@ReubenBond gitter mobile sucks it kept the title of the Orleans chat while I was writing here xd
Reuben Bond
@ReubenBond
No worries :) It happens all the time to me, too, @FluentGuru
FluentGuru
@FluentGuru
@ReubenBond :P anyway I'll hit you up overthere
Wraith2
@Wraith2
@ahsonkhan thanks, I was looking for more of a definition really. I think the target mentioned tracks back into the arcade project GenFacade task for which I can find code but no spec, wondering if the code is the spec in this case.
Wraith2
@Wraith2
a thought. could you use simd to speed up switch statements with multiple cases. for example i'm looking at a switch which maps 6 byte values to the same block of code. the case values aren't sequential so at the moment it's going to generate code to compare against each of those 6. but what if I put all 6 in a vector and then said is the input byte equal to any of the items in a second vector. it'd do the switch in a single instruction wouldn't it? which would speed up a lot of state machines.