Jump to content
Mike Torrettinni

How do you identify bottleneck in Delphi code?

Recommended Posts

I use a profiler and I try to avoid wasting memory allocation.

 

I've seen code searching for POST,PUT,GET,DELETE in a string spread all over the place. Why does one need to search so much? Parse and search once. Use enumerated types. There's a plethora of ready to use structures.
Sometimes too KISSy is not KISS but simply S.

 

 

 

 

 

  • Thanks 1

Share this post


Link to post
23 hours ago, Bill Meyer said:

Performance optimization should be done because of performance issues, not simply to see whether you can buy another 10% improvement in a routine which doesn't affect user perception at all.

 

You forgot one important reason to optimize: The pure fun of it. 😉

  • Like 3

Share this post


Link to post
1 minute ago, dummzeuch said:

You forgot one important reason to optimize: The pure fun of it. 😉

You're right. But I find the fun proportional to the improvement.

Share this post


Link to post
1 hour ago, Bill Meyer said:

You're right. But I find the fun proportional to the improvement.

Hey, I am the German here (*1). But now you sound like one. 😉 Spoilsport!

 

(*1: Of course I am not the only German here.)

  • Haha 1

Share this post


Link to post
Just now, dummzeuch said:

Hey, I am the German here (*1). But now you sound like one. 😉 Spoilsport!

 

(*1: Of course I am not the only German here.)

I'm three generations removed from my German ancestry.

Share this post


Link to post

I just realized I can do a better comparison of new vs old methods, when optimizing code: in the past I would profile old version, and save profiling results, then run new and compare screenshots of timings.

But is much better if you run both methods at the same time and compare results:

 

image.png.0d470dacacd5af79900487df5158cb3f.png

 

This way I can keep both methods in the same code, compare small improvements and I can switch on/off old vs new when profiling and see the progress of eliminating or reducing bottlenecks.

 

 

Edited by Mike Torrettinni

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×