Subscribe to Adventures in Spaghetti code        RSS Feed
-----

33 minutes, 19 lines, 23% more speed!

Icon 2 Comments
I know these posts where the coder brags about how much they sped up their code are pretty boring but this is one case where I just can't resist. I have a code of about 6000 lines, I spent 36 minutes planning how to write the code, and then 33 minutes actually writing 19 lines of new code. Without one bug, I managed to speed the code up from .045 seconds per input to .035 seconds per input! Basically what I did is I have a program that finds contradictions in sentences. I noticed that there was one set of sentences that were irrelevant so I just figured out a way to not search through the irrelevant sentences.

That is definitely one of the most successful coding periods I've ever experienced. This really helps to ease the pain I felt the other day when I spent 4 hours looking for a bug which was caused by downloading the natural language toolkit and forgetting that I installed python 3.4 which messed up my code because my code relies on ordered dictionaries which they have in python 3.6.

2 Comments On This Entry

Page 1 of 1

modi123_1 Icon

29 August 2017 - 08:23 AM
Kudos! I always enjoy those little magic moments.
0

bobsmith76 Icon

29 August 2017 - 10:57 PM
Thanks for the kudos, I really appreciate that.
0
Page 1 of 1

Trackbacks for this entry [ Trackback URL ]

There are no Trackbacks for this entry

October 2017

S M T W T F S
1234567
891011121314
1516171819 20 21
22232425262728
293031    

Tags

    Recent Entries

    Recent Comments

    Search My Blog

    0 user(s) viewing

    0 Guests
    0 member(s)
    0 anonymous member(s)

    Categories