Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7003853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:07:24+00:00 2026-05-27T21:07:24+00:00

I currently coded something awesome based on a JS Library, and I want to

  • 0

I currently coded something awesome based on a JS Library, and I want to remove every useless line that is doing nothing but take more time to download from the server.

What is the best way to keep track of what piece of code was used/unused when my code executed? (So I can remove the unused code)

My first thoughts are to put "var log += "<br />Function name was used." on every function and remove every function that wasn’t called. But I am curious about if there is another way

I want to point out that modifying certain JS Libraries might violate their Licences and possibly cause strong legal issues. So if anyone is reading this and is planning to do the same thing as me, please read carefully the Licence(s) before you even attempt to do this!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:07:25+00:00Added an answer on May 27, 2026 at 9:07 pm

    In my estimation, the best way to keep track of which code has actually executed would be to use a code coverage measurement tool. There are several available for Javascript, many of which are outlined in a previous question: https://stackoverflow.com/questions/53249/are-there-any-good-javascript-code-coverage-tools .

    Of course, this only tracks the code that has executed as a result of the test suite you are running it against, and would not be a foolproof way to find “completely dead” (i.e. unreachable) code. But it’s a start…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently doing something like this in some code I'm working on right now:
I am looking for something that will make it easy to run (correctly coded)
I currently have this class that another programmer in my team coded: public static
In Django, I've got loggers all over the place, currently with hard-coded names. For
The code base I'm currently working on is littered with hard-coded values. I view
Currently my code below works fine but it's a bit of overkill. In my
I am working on a game that is coded in C++ and I would
I have a JSF 2 composite component that employs some Ajax behavior. I want
currently when I code a list I do this: <ul><!-- --><li><a href= title=>something</a></li><!-- --><li><a
I want to make my /pages/about become just `/about I tried doing it with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.