Skip to content
This repository has been archived by the owner on Jan 14, 2022. It is now read-only.

Search performance improvement - Closes #320 #321

Merged
merged 1 commit into from
Oct 25, 2017

Conversation

reyraa
Copy link
Contributor

@reyraa reyraa commented Oct 24, 2017

What we currently have:
We are making Api calls in this sequence:
searchHeight, searchBlock, searchTransaction, searchPublicKey, searchAccount, searchDelegates
Meaning that to get the results of a search for delegate username, we had to make 6 Api calls.

What I do here:
I use the following regex statements

  • /^[0-9]{2,21}[L|l]$/g for address
  • /^[0-9a-f]{64}$/g for publicKey
  • /[a-z!@$&_.]/g which covers pretty much all the delegates
    and if all these cases fails, it will make these requests:
    searchHeight, searchBlock, searchTransaction, searchDelegates.

Since it's possible to choose a number as username, I've put searchDelegate here, but since practically all the existing usernames include at least one character, I've put the searchDelegate last Api call, so it's less likely to be called.

Closes #320

@reyraa reyraa requested a review from Isabello October 24, 2017 19:52
@reyraa reyraa self-assigned this Oct 24, 2017
@reyraa reyraa force-pushed the 320-search-performance-improvement branch from f69b2ca to f361b52 Compare October 25, 2017 09:25
@reyraa reyraa merged commit 35e22ea into 1.3.1 Oct 25, 2017
@reyraa reyraa deleted the 320-search-performance-improvement branch October 25, 2017 14:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants