Well, it would be interesting to see if that improves performance.

As for your question, that's not really a question specific to NHibernate.
It seems the question is more related to general profiling. Write some unit
test or system test that perform a set amount of work and measure it - run
time or using profiling tools. I expect there to be loads of stuff on this
on the web so I won't try to repeat it here. Unless you have a more
specific question on the subject?

The first link you posted also has this very important comment:

> All in all there are some really nice tricks and examples of
> high-performance code to be found in the Roslyn code base. But the main
> lesson is that you should *never* be applying these for the sake of it or
> because they look clever. They should only be used in conjunction with
> proper performance testing that identifies the parts of your code that
> cause it to run slower than your performance goals.
>

It can of course be a fun exercise to refactor some code, but what you can
consider is to try to figure out a test and profile CPU consumption _first_
to find hotspots or identify if something is an actual hotspot before
changing the code. Then that same test should reveal if the change improved
matters.

Another matter is of course if the performance should be measured on some
real-world scenario, or a scenario specifically designed to expose some
suspected hotspot. Both has it's uses, but if the latter one becomes very
contrived it doesn't really matter in the real world and may potentially
actually be harmful.

/Oskar


Den ons 12 juni 2019 kl 09:41 skrev Rafael Lillo <rafael181...@gmail.com>:

> Hi,
>
> I create ObjectPool to share StringBuilder in NHibernate and I would like
> to measure how much memory and CPU is using before and after my change, How
> to do this?
>
>
>
> I made those change based on these article:
>
> https://mattwarren.org/2014/06/10/roslyn-code-base-performance-lessons-part-2/
>
> https://www.elemarjr.com/pt/2017/06/licoes-de-performances-aprendidas-com-roslyn-1-objectpool-e-pooledstringbuilder/
>
>
> I didn't open PR yet
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nhibernate-development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nhibernate-development+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nhibernate-development/d8aea672-348e-47ee-9b38-a91b9195ab48%40googlegroups.com
> <https://groups.google.com/d/msgid/nhibernate-development/d8aea672-348e-47ee-9b38-a91b9195ab48%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nhibernate-development+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nhibernate-development/CAHOuc7NULOwKXat5f685tTCB6p4DTY9ZHqX12pNxhWwYmGTC7g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to