question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Performance refactor

See original GitHub issue

Hello @joshswimlane I was working on a new refactor for improve the performance of pyattck. I wanted to improve the memory usage, unfortunately it was not possible, but the time to parsing the file was huge improvement.

If you want i could create the pull request, it could be a new mayor version on the project. Also i think it could useful create a test for the project.

Please give me feedback about what you think.

Here you are the results and test files used pyattck_test.zip:

Python 2.7

New code:

Memory:
	Max: 71.02Mb
	Min: 19.47Mb
	Median(6): 47.31Mb
Time mem: 0:00:00.353103

Old code:

Memory:
	Max: 78.98Mb
	Min: 17.62Mb
	Median(721): 70.28Mb
Time mem: 0:01:12.166692

Python 3.5

New code:

Memory:
	Max: 43.66Mb
	Min: 22.96Mb
	Median(5): 34.12Mb
Time mem: 0:00:00.223263

Old code:

Memory:
	Max: 42.43Mb
	Min: 21.35Mb
	Median(299): 42.16Mb
Time mem: 0:00:29.845125

Python 3.6

New code:

Memory:
	Max: 41.73Mb
	Min: 22.92Mb
	Median(5): 32.11Mb
Time mem: 0:00:00.221237

Old code:

Memory:
	Max: 45.91Mb
	Min: 21.18Mb
	Median(250): 40.53Mb
Time mem: 0:00:24.916879

Python 3.7

New code:

Memory:
	Max: 41.21Mb
	Min: 21.81Mb
	Median(5): 31.23Mb
Time mem: 0:00:00.232362

Old code:

Memory:
	Max: 41.25Mb
	Min: 21.00Mb
	Median(321): 41.04Mb
Time mem: 0:00:32.049158

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
joshswimlanecommented, Oct 26, 2019

Awesome! I’ll have to look at this next week - I’m on vacation currently - but thanks!

0reactions
joshswimlanecommented, Apr 24, 2020

This has been resolved. If the issue persists please open a new issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Refactoring for performance | by Kickstarter Engineering
I'd like to share how we refactored an expensive MySQL query to Redis and cut over 100ms off typical load times for our...
Read more >
Refactoring Code for Simplicity and Performance
Refactoring your code, whenever possible, is a valuable exercise and will provide immediate and long term benefits to any project that you work ......
Read more >
Does re-factoring of code affect the performance of an ...
Well said! Refactoring may lessen performance, but the change may be negligible. You need to balance the change in the maintainability of the ......
Read more >
IsOptimizationRefactoring - Martin Fowler
When you are refactoring you are thinking about making the code clearer. Your judgement on whether it's successful is based on your (subjective) ......
Read more >
Code Refactoring VS Optimization - Medium
It is the way to modify your existing code to improve the performance without deviating the functionality. Optimize the code means currently ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found