Mads Gram

202 posts

Mads Gram

Mads Gram

@PhDuck2

Computer scientist at Microsoft. Engineer on platform team of Business Central. Opinions are my own. Playing around with languages, compilers, and runtimes.

Denmark Katılım Ekim 2020
44 Takip Edilen354 Takipçiler
Mads Gram
Mads Gram@PhDuck2·
Got the opportunity to go "under the hood" and provide some behind the scenes on how and why we have evolved AL over the years towards a more performant language. youtu.be/1xdpUmeun-s
YouTube video
YouTube
English
0
0
1
97
Mads Gram
Mads Gram@PhDuck2·
If you are interested in writing performant AL code for Business Central, this is a great opportunity. You get a three for one deal here! AL code, compiler, and runtime experts in one session. As always when I'm involved, internals included! Wednesday at 14:00. #msdyn365bc
Mads Gram tweet media
English
1
2
20
436
Mads Gram
Mads Gram@PhDuck2·
@KarolakNatalie We just fixed this, before it would loop forever. Found some tasks that had executed for more than 50k times.
English
0
0
2
107
Natalie Karolak - 𝑩𝑪 𝑫𝒐𝒄𝒔 𝑳𝒊𝒃𝒓𝒂𝒓𝒊𝒂𝒏
Task scheduler learn.microsoft.com/en-us/dynamics… AL methods that throw nonretriable exceptions in background sessions #al-methods-that-throw-nonretriable-exceptions-in-background-sessions" target="_blank" rel="nofollow noopener">learn.microsoft.com/en-us/dynamics… Did you know? Stopping the main codeunit with Dialog.Error('') is considered a successful operation, so the failure codeunit isn't executed.
English
1
0
0
235
Mads Gram
Mads Gram@PhDuck2·
@phenno1 @erpthoughts Yes, but also smart sql, where we merge the calcfields into the query. There was also some other scenarios regards table relations, but I cannot remember of the top of my head.
English
0
0
1
46
phenno
phenno@phenno1·
@PhDuck2 @erpthoughts I suppose you're talking on potential subsequent calcfields? Maybe I'm missing some other scenarios...
English
1
0
0
53
Mads Gram
Mads Gram@PhDuck2·
@phenno1 @erpthoughts 2) To filter on flowfields, we might need the value of another field to be present. We could JIT load out when loading the flowfield. Both comes with trade-offs, eager adds a small extra cost (a few more fields) while JIT means it might fail due to the record having changed.
English
1
0
2
77
Mads Gram
Mads Gram@PhDuck2·
@phenno1 @erpthoughts 1) Please read the remarks part on the same docs. Which states the runtime might sometimes require more fields to be loaded. The full list depends on platform version.
English
1
0
3
70
Mads Gram
Mads Gram@PhDuck2·
@MansaYay @StefanMaron @waldo1001 The key element is what the NST does with tri-state: it places a READCOMMIITTED hint on the sql statement. How SQL server interprets that hint and executes it, that depends on your setup. With RCSI no shared locks are taken, relying on row versioning and snapshot info.
English
0
0
0
71
Mansa
Mansa@MansaYay·
@StefanMaron @waldo1001 Just realized @PhDuck2 said ReadCommitted reads will use shared locks in the presentation but afaik that doesn't happen when reading with RCSI? Am I missing something or was this over-simplified in the presentation?
English
2
0
0
45
Mads Gram
Mads Gram@PhDuck2·
@arthrvdv A succes metric for me is that people go away from the session with information enough to make an educated decision on that. I hope you will turn it on, but that is up to you to decide after. My blog post addresses it in a slightly more theoretical way: bcinternals.com/posts/tri-stat…
English
1
0
1
86
Arthur van de Vondervoort
Arthur van de Vondervoort@arthrvdv·
@PhDuck2 Looking forward to this session! It’s tempting to enable this in Feature Management today. For me, to be honest, quite difficult to understand the possible implications of this.
English
6
0
0
107
Mads Gram
Mads Gram@PhDuck2·
I would argue the perfect last session for your #BCTechDays conference is to join Torben Meyhoff and I, for our session: Tri-State Locking: Reducing locking in the runtime We will explain AL's locking scheme in-depth and explore recent improvements in the area.
Mads Gram tweet media
English
3
6
30
1.4K
Mads Gram
Mads Gram@PhDuck2·
@erpthoughts The slide with lock escalation is even fixed this year :)
English
1
0
1
96
Mads Gram
Mads Gram@PhDuck2·
@KarolakNatalie I think you reading too much into it, "performed optimally" here doesn't have to refer to performance. It is non-optimal to read uncommitted when you anyways modify it just after. The modify may even fail if someone else inserted the row and don't end up committing the row.
English
1
0
1
110
Mads Gram
Mads Gram@PhDuck2·
@KarolakNatalie It might be that the code came in before I changed it. Until recently FindSet(true) did LockTable.
English
0
0
0
103
Stefan Maroń
Stefan Maroń@StefanMaron·
Yak shaving at its finest again today. #msdyn365bc Did anyone have this error before? There is no call stack, but it happens only if I run the Code coverage. It also happens when not using UI but the AL Test Runner vs code extension.
Stefan Maroń tweet mediaStefan Maroń tweet media
English
6
1
2
1.1K
Mads Gram
Mads Gram@PhDuck2·
@mortenbraemer We didn't see too many places where the feature would be necessary, so OnPrem first. If the community is eager for the feature, we will re-consider it. In the longer term we are thinking about allowing admins to allow persistent disable/enable on an environment.
English
2
0
3
205
Mads Gram
Mads Gram@PhDuck2·
Have you ever wondered how to swiftly delete data in #msdyn365bc? Most of the time, letting the runtime optimize is the way to go. In my latest blog post we explore how customizations can bring the performance down + an informal reveal of AlterKey :) bcinternals.com/posts/deleting…
English
4
3
14
1.4K
Mads Gram
Mads Gram@PhDuck2·
@dan_flr We have been talking about introducing a TRUNCATE TABLE AL statement. However, the question is always how often do developers really need to empty the entire table?
English
4
0
4
318
Mads Gram
Mads Gram@PhDuck2·
@waldo1001 Can you check if your previous deadlocks were coming from SELECT statements with UPDLOCK, since these should now be reading with READCOMMITTED instead.
English
1
0
0
125
waldo - waldo1001.bsky.social
@PhDuck2 No hard evidence - but I have a strong feeling it's the TriState locking, since we applied "partial records" like .. uhm .. like maniacs.. ;-)
English
1
0
0
145