Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency @snaplet/copycat to v0.18.1 #61

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 15, 2022

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@snaplet/copycat ^0.13.4 -> ^0.18.0 age adoption passing confidence
@snaplet/copycat ^0.12.0 -> ^0.18.0 age adoption passing confidence
@snaplet/copycat 0.12.1 -> 0.18.1 age adoption passing confidence

Release Notes

snaplet/copycat (@​snaplet/copycat)

v0.18.1

Compare Source

⚠ BREAKING CHANGES
Performance improvements

In order to always return the same output for the same input, copycat works by hashing the given input value to a number, and then using the resulting number to compute the output value. Under the hood, we use SipHash to do this (more context here).

Sometimes though, we need a sequence of numbers to compute an output, rather than a single number. A good example of this is copycat.scramble(), where we need a sequence of numbers, one for each character in the input. In these cases, we were using SipHash to compute the initial hash, and then for each number in the sequence, use the faster fnv1a to re-hash the current hash value to obtain the next number in the sequence in a deterministic way.

However, the tool we're looking for in this case is a seeded deterministic pseudo-random number generator (PRNG). In turns out there are much faster algorithms for accomplishing this than using fnv1a, which is really more a hash function than a PRNG. After experimenting a bit, we settled on using splitmix.

What does this mean for me?

This sequencing functionality described above is a core part of copycat. Any method relying on this sequencing functionality (transitively via other copycat methods or directly) would be impacted. In the case of large outputs, you might see computation time performance improvements (benchmarks for copycat.scramble() below).

However, it also means that for all the affected methods, the same input value would now map to an entirely different output value (since we changed the underlying function we were using for computing a sequence of numbers for a given hash value). That said, the same input value will still map to that same output value, it is just that the output value is different to what it was in previous releases. In other words, copycat is still deterministic, it is just that this release came with a change to the mapping from inputs to outputs.

Benchmark results for copycat.scramble()
{
  "name": "100 words",
  "results": [
    {
      "ms": 0.8084074373484236,
      "name": "copycat.scramble(): before (0.17.3)",
      "ops": 1237,
      "percentSlower": 94.96
    },
    {
      "ms": 0.04073485681697829,
      "name": "copycat.scramble(): after (reimplementation)",
      "ops": 24549,
      "percentSlower": 0
    }
  ]
}
{
  "name": "100000 words",
  "results": [
    {
      "ms": 1000,
      "name": "copycat.scramble(): before (0.17.3)",
      "ops": 1,
      "percentSlower": 93.33
    },
    {
      "ms": 66.66666666666667,
      "name": "copycat.scramble(): after (reimplementation)",
      "ops": 15,
      "percentSlower": 0
    }
  ]
}

More context here: https://github.com/snaplet/copycat/pull/45

Lorem ipsum

copycat.word() and other word methods (@copycat.words(), @copycat.paragraph() and @copycat.sentence()) changed from generating text like this:

Kai ni viramira memayo kayu. Hahyceavi nameta mohy shichiacea menivayu shi mika yokinmu, nahyraki hyka chi niceavi ta. Ta hamevakin yuno hyakova nivami yohycea ko, yoha shiyu miha hy kiko kinyoshi ka ninoshi. Notakimu yo yukake kakekaihy vaceaso vakiso nomu rae, yukin chiraekimo ceavino yo muyo. Hyva memayo shikemavi ka kakesokin mamuhamo kinmukame mora, ranino masochiyo kinoa kesoni mamo. Va nohakin komiva shimo hykikayo makinra yorae, sovami kai raenira raeyo sonavi mo mora chirae

To text like this:

Et modo lucilias legatomnem et. Quis ratio iudicur ut defuitur quod interessar endis, doloria romandum athenisse explicem quia. Expeten quam hoc ex amus ant sive, providintem ad claudicur torquato nes nihil nec ut. Audiri dicerea summum arisset ne exceperem tam si, amartifex doloris nam quae ipsum. Et causa iudicitat extremum endam tota tum antippus, de vidi videbo rerum ut. Affere ab mundi nimium summa partemerror causae, his am semperfruique in sapiens gloriatur et dicenim
Context

The idea behind the way we used to generate words, was to use Japanese-like syllables for simplicity, since they compose easily (any syllable can follow any other).

It would be more ideal though to use something more standard and expected, such as "lorem ipsum" placeholder text. It is also arguably a better representation of fake text that is meant to be read (e.g. on a web page) - since we generate words with latin characters. Latin words are naturally more representative of where these characters would be seen. In contrast, the previous fake text is not - it is closer to resembling a romanized form of text from a language not written with latin characters, and so it is probably less representative of what would appear as text meant to be read (e.g. on a web page).

More context here: https://github.com/snaplet/copycat/pull/46

v0.18.0

Compare Source

v0.17.3

Compare Source

v0.17.2

Compare Source

v0.17.1

Compare Source

v0.17.0

Compare Source

v0.16.0

Compare Source

v0.15.1

Compare Source

v0.15.0

Compare Source

v0.14.0

Compare Source


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@netlify
Copy link

netlify bot commented Dec 15, 2022

Deploy Preview for rw-office-hours-og-images failed.

Name Link
🔨 Latest commit b850ace
🔍 Latest deploy log https://app.netlify.com/sites/rw-office-hours-og-images/deploys/6540d02331dc63000895be8e

@netlify
Copy link

netlify bot commented Dec 15, 2022

Deploy Preview for rw-office-hours-algolia-autocomplete ready!

Name Link
🔨 Latest commit b850ace
🔍 Latest deploy log https://app.netlify.com/sites/rw-office-hours-algolia-autocomplete/deploys/6540d0233dc0b800081f14bb
😎 Deploy Preview https://deploy-preview-61--rw-office-hours-algolia-autocomplete.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@netlify
Copy link

netlify bot commented Dec 15, 2022

Deploy Preview for rw-office-hours-rest-directive failed.

Name Link
🔨 Latest commit b850ace
🔍 Latest deploy log https://app.netlify.com/sites/rw-office-hours-rest-directive/deploys/6540d0239610bb0008321eb6

@netlify
Copy link

netlify bot commented Dec 15, 2022

Deploy Preview for rw-office-hours-custom-auth failed.

Name Link
🔨 Latest commit b850ace
🔍 Latest deploy log https://app.netlify.com/sites/rw-office-hours-custom-auth/deploys/6540d02327546b00080eef1a

@netlify
Copy link

netlify bot commented Dec 15, 2022

Deploy Preview for rw-office-hours-enum-select-list failed.

Name Link
🔨 Latest commit b850ace
🔍 Latest deploy log https://app.netlify.com/sites/rw-office-hours-enum-select-list/deploys/6540d023a0d2f60008c579fd

@renovate renovate bot force-pushed the renovate/snaplet-copycat-0.x branch from fa7aa4e to 49b89b5 Compare December 20, 2022 16:25
@renovate renovate bot changed the title Update dependency @snaplet/copycat to v0.13.0 Update dependency @snaplet/copycat to v0.13.2 Dec 20, 2022
@renovate renovate bot force-pushed the renovate/snaplet-copycat-0.x branch from 49b89b5 to d2e6035 Compare January 4, 2023 12:35
@renovate renovate bot changed the title Update dependency @snaplet/copycat to v0.13.2 Update dependency @snaplet/copycat to v0.13.4 Jan 4, 2023
@renovate renovate bot changed the title Update dependency @snaplet/copycat to v0.13.4 Update dependency @snaplet/copycat to v0.14.0 Jun 15, 2023
@renovate renovate bot force-pushed the renovate/snaplet-copycat-0.x branch from d2e6035 to 3037f8b Compare June 15, 2023 17:51
@renovate renovate bot changed the title Update dependency @snaplet/copycat to v0.14.0 Update dependency @snaplet/copycat to v0.15.1 Jul 12, 2023
@renovate renovate bot force-pushed the renovate/snaplet-copycat-0.x branch from 3037f8b to ad3f53a Compare July 12, 2023 13:43
@renovate renovate bot changed the title Update dependency @snaplet/copycat to v0.15.1 Update dependency @snaplet/copycat to v0.15.1 - autoclosed Jul 14, 2023
@renovate renovate bot closed this Jul 14, 2023
@renovate renovate bot deleted the renovate/snaplet-copycat-0.x branch July 14, 2023 21:04
@renovate renovate bot changed the title Update dependency @snaplet/copycat to v0.15.1 - autoclosed Update dependency @snaplet/copycat to v0.15.1 Jul 15, 2023
@renovate renovate bot reopened this Jul 15, 2023
@renovate renovate bot restored the renovate/snaplet-copycat-0.x branch July 15, 2023 01:41
@renovate renovate bot changed the title Update dependency @snaplet/copycat to v0.15.1 Update dependency @snaplet/copycat to v0.16.0 Aug 7, 2023
@renovate renovate bot force-pushed the renovate/snaplet-copycat-0.x branch from ad3f53a to b1ef779 Compare August 7, 2023 13:48
@renovate renovate bot force-pushed the renovate/snaplet-copycat-0.x branch from b1ef779 to c286b36 Compare September 13, 2023 12:39
@renovate renovate bot changed the title Update dependency @snaplet/copycat to v0.16.0 Update dependency @snaplet/copycat to v0.17.0 Sep 13, 2023
@renovate renovate bot force-pushed the renovate/snaplet-copycat-0.x branch from c286b36 to a279a6b Compare September 13, 2023 20:00
@renovate renovate bot changed the title Update dependency @snaplet/copycat to v0.17.0 Update dependency @snaplet/copycat to v0.17.1 Sep 13, 2023
@renovate renovate bot force-pushed the renovate/snaplet-copycat-0.x branch from a279a6b to 8ff1f9c Compare September 20, 2023 11:12
@renovate renovate bot changed the title Update dependency @snaplet/copycat to v0.17.1 Update dependency @snaplet/copycat to v0.17.2 Sep 20, 2023
@renovate renovate bot force-pushed the renovate/snaplet-copycat-0.x branch from 8ff1f9c to 1340d5d Compare September 20, 2023 17:02
@renovate renovate bot changed the title Update dependency @snaplet/copycat to v0.17.2 Update dependency @snaplet/copycat to v0.17.3 Sep 20, 2023
@renovate renovate bot force-pushed the renovate/snaplet-copycat-0.x branch from 1340d5d to b850ace Compare October 31, 2023 10:00
@renovate renovate bot changed the title Update dependency @snaplet/copycat to v0.17.3 Update dependency @snaplet/copycat to v0.18.1 Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants