Skip to content

Using prototypes is slow #214

@ghost

Description

I did a benchmark test, and it turns out using prototypes makes a function call twice slower in Google Chrome, and in Firefox, it is 4-5 times slower!!! So, when you're writing a function library for strings where speed is of concern, then you should declare functions like this :

function truncate(str, length, pruneStr) { ... } // this is just an example

DO NOT USE PROTOTYPES. They needlessly slow down the execution of your code!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions