Giter Site home page Giter Site logo

Comments (6)

asilluron avatar asilluron commented on June 9, 2024 1

Just to confirm, you changed str to jklfjdslkfj ?

from jsperf.com.

ineeee avatar ineeee commented on June 9, 2024

changing the setup variable name to jklfjdslkfj fixed it: https://jsperf.com/two-comma-separated-values-split-vs-substring

what the hell man, cloudflare is stupid

from jsperf.com.

ineeee avatar ineeee commented on June 9, 2024

Yes (well, close). I changed str to jfdlksj and successfully submitted:

screenshot

I replaced all instances of str with jfdlksj in the setup, test case 1 and test case 2, and successfully bypassed CloudFlare's block.

from jsperf.com.

rstaib avatar rstaib commented on June 9, 2024

I have been blocked as well.

Preparation Code:

<script>
  function createRandomString() {
    const text = "";
    const possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

    for (let i = 0; i < 5; i++) {
      text += possible.charAt(Math.floor(Math.random() * possible.length));
    }

    return text;
  }

  Benchmark.prototype.setup = function () {
    const emptyMap = new Map();
    const emptyObj = {};
    const map = new Map();
    const obj = {};
    const predefinedKey = createRandomString();
    const predefinedVal = createRandomString();

    for (let i = 0; i < 1000; i++) {
      const key = createRandomString();
      const val = createRandomString();

      map.set(key, val);
      obj[key] = val;
    }
  };
</script>

Code snippet 1:

emptyMap.set(predefinedKey, predefinedVal);

Code snippet 2:

emptyObj[predefinedKey] = predefinedVal;

Code snippet 3:

for (let key of map.keys()) {
  const val = map.get(key);
}

Code snippet 4:

for (let key of Object.keys(obj)) {
  const val = obj[key];
}

from jsperf.com.

rsp avatar rsp commented on June 9, 2024

I have just been blocked trying to create a benchmark with the following code:

Preparation code:

<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.15/lodash.core.min.js"></script>
<script>
// from: https://stackoverflow.com/a/43044212/613198
_.insertSorted = (a, v) => a.splice(_.sortedIndex(a, v), 0, v);
_.insertSortedBy = (a, v, i) => a.splice(_.sortedIndexBy(a, v, i), 0, v);
</script>

Setup for all tests:

let inputArray = [
  {
    "id": "06BCCC25",
    "displayName":"Application"
  },
  {
    "id": "39F886D9", 
    "displayName":"Communication"
  },
  {
    "id": "22EA4ED5",
     "displayName":"Device"
  },
  {
    "id": "2F6E5FEA",
     "displayName":"Service"
  },
  {
    "id": "317BF72C", "displayName":"Service02"
  }
];

let newValue = {
    "id": "07BSSC25",
    "displayName":"Mail"
};

I've been using jsPerf for many years and it would be a pity if I had to look around for an alternative.
I don't think using Cloudflare can really work for this sort of project because I believe it is blocking me because I enter JavaScript in text fields and it thinks I'm trying to make a XSS or similar attack.
In fact I will have to stop using jsPerl until it is resolved, because even if some people here suggested changing variable names to fool the Cloudflare's attack detection, I don't want to be flagged by Cloudflare as someone who attacks websites.

I would suggest checking what CDN or DDoS protection, if any, is used by:

  • JSBin
  • jsFiddle
  • CodePen

because this has never happened to me on those websites.

from jsperf.com.

dlynchcodes avatar dlynchcodes commented on June 9, 2024

I was also blocked doing nothing out of the ordinary. Just loading jquery and fomantic-ui.

from jsperf.com.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.