﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Laptop Repair commented on Reducing the cost of getting a stack trace</title><description>Thanks for posting this kind of ideas and tips, it's an additional knowledge from what I know before, keep up the good work
</description><link>http://ayende.com/3879/reducing-the-cost-of-getting-a-stack-trace#comment10</link><guid>http://ayende.com/3879/reducing-the-cost-of-getting-a-stack-trace#comment10</guid><pubDate>Fri, 20 Feb 2009 02:38:23 GMT</pubDate></item><item><title>Ayende Rahien commented on Reducing the cost of getting a stack trace</title><description>Fabian,
  
I am using rgMethodHandle and rgiILOffset as compound cache key, which will work just fine for my needs, since it match a location in a the source file.
  
Generic methods are actually not a problem for me, since I am only interested in the source line.
  
And since I only care about the uniqueness of the stack trace, I don't need to get GetMethodBase(), and can use the RuntimeMethodHandle
  
  
</description><link>http://ayende.com/3879/reducing-the-cost-of-getting-a-stack-trace#comment9</link><guid>http://ayende.com/3879/reducing-the-cost-of-getting-a-stack-trace#comment9</guid><pubDate>Tue, 17 Feb 2009 11:59:43 GMT</pubDate></item><item><title>Fabian Schmied commented on Reducing the cost of getting a stack trace</title><description>Ayende,
  
  
you can probably form a compound cache key from the rgMethodHandle field inside of the StackFrameHelper (but beware of generic methods, where the handles are not unique per specialization!). Apart from that, the names of the methods on the stack are only available via StackFrameHelper.GetMethodBase.
  
  
And once you iterate over the frames and call GetMethodBase, you're basically back to what the "official" StackTrace class does. (Minus a few ms, maybe, when you optimize it for your needs, but never a two-third reduction...) And this at the cost of using some extremely brittle code, which is bound to break sooner or later, especially if you have a heterogeneous user base. (Which, I guess, you would have with NH Prof.)
  
  
Maybe in your current use case the advantages outweigh the disadvantages, but in most cases, I think it wouldn't be worth the trouble.
</description><link>http://ayende.com/3879/reducing-the-cost-of-getting-a-stack-trace#comment8</link><guid>http://ayende.com/3879/reducing-the-cost-of-getting-a-stack-trace#comment8</guid><pubDate>Tue, 17 Feb 2009 09:57:05 GMT</pubDate></item><item><title>Stephen commented on Reducing the cost of getting a stack trace</title><description>I don't think its a huge problem, you can probably use the old style in the event you can't use the cheat right?
</description><link>http://ayende.com/3879/reducing-the-cost-of-getting-a-stack-trace#comment7</link><guid>http://ayende.com/3879/reducing-the-cost-of-getting-a-stack-trace#comment7</guid><pubDate>Mon, 16 Feb 2009 17:42:17 GMT</pubDate></item><item><title>Ayende Rahien commented on Reducing the cost of getting a stack trace</title><description>Stephen,
  
I am assuming FullTrust, but I haven't considered this.
</description><link>http://ayende.com/3879/reducing-the-cost-of-getting-a-stack-trace#comment6</link><guid>http://ayende.com/3879/reducing-the-cost-of-getting-a-stack-trace#comment6</guid><pubDate>Mon, 16 Feb 2009 16:58:33 GMT</pubDate></item><item><title>Ayende Rahien commented on Reducing the cost of getting a stack trace</title><description>I can use that to get RuntimeMethodHandle, which is good enough to create a cache key.
</description><link>http://ayende.com/3879/reducing-the-cost-of-getting-a-stack-trace#comment5</link><guid>http://ayende.com/3879/reducing-the-cost-of-getting-a-stack-trace#comment5</guid><pubDate>Mon, 16 Feb 2009 16:56:33 GMT</pubDate></item><item><title>Stephen commented on Reducing the cost of getting a stack trace</title><description>Whats the trust level to invoke that method? only a lot of web hosting is medium trust.
</description><link>http://ayende.com/3879/reducing-the-cost-of-getting-a-stack-trace#comment4</link><guid>http://ayende.com/3879/reducing-the-cost-of-getting-a-stack-trace#comment4</guid><pubDate>Mon, 16 Feb 2009 16:32:56 GMT</pubDate></item><item><title>mendicant commented on Reducing the cost of getting a stack trace</title><description>We have cows all over downtown calgary that are painted up like that horse. I had almost forgotten the atroscities until this post.
</description><link>http://ayende.com/3879/reducing-the-cost-of-getting-a-stack-trace#comment3</link><guid>http://ayende.com/3879/reducing-the-cost-of-getting-a-stack-trace#comment3</guid><pubDate>Mon, 16 Feb 2009 16:15:35 GMT</pubDate></item><item><title>configurator commented on Reducing the cost of getting a stack trace</title><description>What do you do with the StackFrameHelper you receive?
  
</description><link>http://ayende.com/3879/reducing-the-cost-of-getting-a-stack-trace#comment2</link><guid>http://ayende.com/3879/reducing-the-cost-of-getting-a-stack-trace#comment2</guid><pubDate>Mon, 16 Feb 2009 15:51:51 GMT</pubDate></item><item><title>Benny Thomas commented on Reducing the cost of getting a stack trace</title><description>I hate internal types and method that clearly would help when extending the .net enviroment!
  
  
I almost created my own CheckedListBox in pure frustration.
</description><link>http://ayende.com/3879/reducing-the-cost-of-getting-a-stack-trace#comment1</link><guid>http://ayende.com/3879/reducing-the-cost-of-getting-a-stack-trace#comment1</guid><pubDate>Mon, 16 Feb 2009 14:40:18 GMT</pubDate></item></channel></rss>